diff --git a/MongoRepository.nuspec b/MongoRepository.nuspec index 559da6e..77274c1 100644 --- a/MongoRepository.nuspec +++ b/MongoRepository.nuspec @@ -3,7 +3,7 @@ MongoRepository MongoRepository - 1.6.8 + 1.7.0 tgeek, RobIII tgeek http://mongorepository.codeplex.com/license @@ -13,21 +13,18 @@ mongo mongodb repository http://download-codeplex.sec.s-msft.com/Download?ProjectName=mongorepository&DownloadId=334950&Build=19692 - Updated to MongoCSharp driver 1.10 + Updated to MongoCSharp legacy driver 2.0 + Removed support for net3.5 and net4.0 Provides a repository pattern on top of 10gen's MongoDB C# driver. en-US - + - - - - diff --git a/MongoRepository.sln b/MongoRepository.sln index a23b6c9..f2e0fc9 100644 --- a/MongoRepository.sln +++ b/MongoRepository.sln @@ -1,10 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoRepository.Net40", "MongoRepository\MongoRepository.Net40.csproj", "{E2C4A7F9-4B14-46CB-BFCE-AFABFACB3390}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoRepositoryTests", "MongoRepositoryTests\MongoRepositoryTests.csproj", "{7C8276C3-819A-4EA1-BFDA-64C3760B0037}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D62DDBAF-08C6-4130-890A-888910785B65}" @@ -24,8 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{288E65 .nuget\NuGet.targets = .nuget\NuGet.targets EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoRepository.Net35", "MongoRepository\MongoRepository.Net35.csproj", "{9D7ED6B5-2B34-4EC6-88CF-CDA2F07431AC}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MongoRepository.Net45", "MongoRepository\MongoRepository.Net45.csproj", "{CE75B2FE-C027-42F6-8D00-E44CC38BE7C7}" EndProject Global @@ -34,18 +30,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E2C4A7F9-4B14-46CB-BFCE-AFABFACB3390}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E2C4A7F9-4B14-46CB-BFCE-AFABFACB3390}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E2C4A7F9-4B14-46CB-BFCE-AFABFACB3390}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E2C4A7F9-4B14-46CB-BFCE-AFABFACB3390}.Release|Any CPU.Build.0 = Release|Any CPU {7C8276C3-819A-4EA1-BFDA-64C3760B0037}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7C8276C3-819A-4EA1-BFDA-64C3760B0037}.Debug|Any CPU.Build.0 = Debug|Any CPU {7C8276C3-819A-4EA1-BFDA-64C3760B0037}.Release|Any CPU.ActiveCfg = Release|Any CPU {7C8276C3-819A-4EA1-BFDA-64C3760B0037}.Release|Any CPU.Build.0 = Release|Any CPU - {9D7ED6B5-2B34-4EC6-88CF-CDA2F07431AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D7ED6B5-2B34-4EC6-88CF-CDA2F07431AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D7ED6B5-2B34-4EC6-88CF-CDA2F07431AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D7ED6B5-2B34-4EC6-88CF-CDA2F07431AC}.Release|Any CPU.Build.0 = Release|Any CPU {CE75B2FE-C027-42F6-8D00-E44CC38BE7C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CE75B2FE-C027-42F6-8D00-E44CC38BE7C7}.Debug|Any CPU.Build.0 = Debug|Any CPU {CE75B2FE-C027-42F6-8D00-E44CC38BE7C7}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/MongoRepository/MongoRepository.Net35.csproj b/MongoRepository/MongoRepository.Net35.csproj deleted file mode 100644 index 4ae9dfd..0000000 --- a/MongoRepository/MongoRepository.Net35.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {9D7ED6B5-2B34-4EC6-88CF-CDA2F07431AC} - Library - Properties - MongoRepository - MongoRepository.Net35 - v3.5 - 512 - SAK - SAK - SAK - SAK - ..\..\MongoRepository\ - true - - - true - full - false - bin\Debug\ - TRACE;DEBUG;NET35 - prompt - 4 - - - - - pdbonly - true - bin\Release\ - TRACE;NET35 - prompt - 4 - bin\Release\MongoRepository.Net35.xml - - - - False - ..\packages\mongocsharpdriver.1.10.0\lib\net35\MongoDB.Bson.dll - - - False - ..\packages\mongocsharpdriver.1.10.0\lib\net35\MongoDB.Driver.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MongoRepository/MongoRepository.Net40.csproj b/MongoRepository/MongoRepository.Net40.csproj deleted file mode 100644 index 896363d..0000000 --- a/MongoRepository/MongoRepository.Net40.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {E2C4A7F9-4B14-46CB-BFCE-AFABFACB3390} - Library - Properties - MongoRepository - MongoRepository.Net40 - v4.0 - 512 - SAK - SAK - SAK - SAK - ..\..\MongoRepository\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\MongoRepository.Net40.xml - - - - False - ..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Bson.dll - - - False - ..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Driver.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MongoRepository/MongoRepository.Net45.csproj b/MongoRepository/MongoRepository.Net45.csproj index 3b74e54..3a70c06 100644 --- a/MongoRepository/MongoRepository.Net45.csproj +++ b/MongoRepository/MongoRepository.Net45.csproj @@ -40,13 +40,21 @@ bin\Release\MongoRepository.Net45.xml - - False - ..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Bson.dll + + ..\packages\MongoDB.Bson.2.0.1\lib\net45\MongoDB.Bson.dll + True - - False - ..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Driver.dll + + ..\packages\MongoDB.Driver.2.0.1\lib\net45\MongoDB.Driver.dll + True + + + ..\packages\MongoDB.Driver.Core.2.0.1\lib\net45\MongoDB.Driver.Core.dll + True + + + ..\packages\mongocsharpdriver.2.0.1\lib\net45\MongoDB.Driver.Legacy.dll + True diff --git a/MongoRepository/Repository/IRepository.cs b/MongoRepository/Repository/IRepository.cs index 954cdce..50deab0 100644 --- a/MongoRepository/Repository/IRepository.cs +++ b/MongoRepository/Repository/IRepository.cs @@ -94,36 +94,6 @@ public interface IRepository : IQueryable /// The expression. /// True when an entity matching the predicate exists, false otherwise. bool Exists(Expression> predicate); - - /// - /// Lets the server know that this thread is about to begin a series of related operations that must all occur - /// on the same connection. The return value of this method implements IDisposable and can be placed in a using - /// statement (in which case RequestDone will be called automatically when leaving the using statement). - /// - /// A helper object that implements IDisposable and calls RequestDone() from the Dispose method. - /// - /// Sometimes a series of operations needs to be performed on the same connection in order to guarantee correct - /// results. This is rarely the case, and most of the time there is no need to call RequestStart/RequestDone. - /// An example of when this might be necessary is when a series of Inserts are called in rapid succession with - /// SafeMode off, and you want to query that data in a consistent manner immediately thereafter (with SafeMode - /// off the writes can queue up at the server and might not be immediately visible to other connections). Using - /// RequestStart you can force a query to be on the same connection as the writes, so the query won't execute - /// until the server has caught up with the writes. - /// A thread can temporarily reserve a connection from the connection pool by using RequestStart and - /// RequestDone. You are free to use any other databases as well during the request. RequestStart increments a - /// counter (for this thread) and RequestDone decrements the counter. The connection that was reserved is not - /// actually returned to the connection pool until the count reaches zero again. This means that calls to - /// RequestStart/RequestDone can be nested and the right thing will happen. - /// - IDisposable RequestStart(); - - /// - /// Lets the server know that this thread is done with a series of related operations. - /// - /// - /// Instead of calling this method it is better to put the return value of RequestStart in a using statement. - /// - void RequestDone(); } /// diff --git a/MongoRepository/Repository/MongoRepository.cs b/MongoRepository/Repository/MongoRepository.cs index 4ea2e9c..911bcde 100644 --- a/MongoRepository/Repository/MongoRepository.cs +++ b/MongoRepository/Repository/MongoRepository.cs @@ -235,51 +235,6 @@ public virtual bool Exists(Expression> predicate) return this.collection.AsQueryable().Any(predicate); } - /// - /// Lets the server know that this thread is about to begin a series of related operations that must all occur - /// on the same connection. The return value of this method implements IDisposable and can be placed in a using - /// statement (in which case RequestDone will be called automatically when leaving the using statement). - /// - /// A helper object that implements IDisposable and calls RequestDone() from the Dispose method. - /// - /// - /// Sometimes a series of operations needs to be performed on the same connection in order to guarantee correct - /// results. This is rarely the case, and most of the time there is no need to call RequestStart/RequestDone. - /// An example of when this might be necessary is when a series of Inserts are called in rapid succession with - /// SafeMode off, and you want to query that data in a consistent manner immediately thereafter (with SafeMode - /// off the writes can queue up at the server and might not be immediately visible to other connections). Using - /// RequestStart you can force a query to be on the same connection as the writes, so the query won't execute - /// until the server has caught up with the writes. - /// - /// - /// A thread can temporarily reserve a connection from the connection pool by using RequestStart and - /// RequestDone. You are free to use any other databases as well during the request. RequestStart increments a - /// counter (for this thread) and RequestDone decrements the counter. The connection that was reserved is not - /// actually returned to the connection pool until the count reaches zero again. This means that calls to - /// RequestStart/RequestDone can be nested and the right thing will happen. - /// - /// - /// Use the connectionstring to specify the readpreference; add "readPreference=X" where X is one of the following - /// values: primary, primaryPreferred, secondary, secondaryPreferred, nearest. - /// See http://docs.mongodb.org/manual/applications/replication/#read-preference - /// - /// - public virtual IDisposable RequestStart() - { - return this.collection.Database.RequestStart(); - } - - /// - /// Lets the server know that this thread is done with a series of related operations. - /// - /// - /// Instead of calling this method it is better to put the return value of RequestStart in a using statement. - /// - public virtual void RequestDone() - { - this.collection.Database.RequestDone(); - } - #region IQueryable /// /// Returns an enumerator that iterates through a collection. diff --git a/MongoRepository/RepositoryManager/MongoRepositoryManager.cs b/MongoRepository/RepositoryManager/MongoRepositoryManager.cs index 8659349..6873efb 100644 --- a/MongoRepository/RepositoryManager/MongoRepositoryManager.cs +++ b/MongoRepository/RepositoryManager/MongoRepositoryManager.cs @@ -235,7 +235,8 @@ public virtual void ReIndex() [Obsolete("This method will be removed in the next version of the driver")] public virtual long GetTotalDataSize() { - return this.collection.GetTotalDataSize(); + var stats = this.collection.GetStats(); + return stats.DataSize + stats.TotalIndexSize; } /// @@ -245,7 +246,7 @@ public virtual long GetTotalDataSize() [Obsolete("This method will be removed in the next version of the driver")] public virtual long GetTotalStorageSize() { - return this.collection.GetTotalStorageSize(); + return this.collection.GetStats().StorageSize; } /// diff --git a/MongoRepository/packages.config b/MongoRepository/packages.config index f5b0d46..17a61b0 100644 --- a/MongoRepository/packages.config +++ b/MongoRepository/packages.config @@ -1,4 +1,7 @@  - + + + + \ No newline at end of file diff --git a/MongoRepositoryTests/App.config b/MongoRepositoryTests/App.config index 55ed765..f968bd8 100644 --- a/MongoRepositoryTests/App.config +++ b/MongoRepositoryTests/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/MongoRepositoryTests/MongoRepositoryTests.csproj b/MongoRepositoryTests/MongoRepositoryTests.csproj index 2d1ca9f..c1dd2e5 100644 --- a/MongoRepositoryTests/MongoRepositoryTests.csproj +++ b/MongoRepositoryTests/MongoRepositoryTests.csproj @@ -11,7 +11,7 @@ Properties MongoRepositoryTests MongoRepositoryTests - v4.0 + v4.5 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} SAK @@ -20,6 +20,7 @@ SAK ..\..\MongoRepository\ true + true @@ -29,6 +30,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -37,17 +39,26 @@ TRACE prompt 4 + false - - False - ..\packages\mongocsharpdriver.1.10.0\lib\net35\MongoDB.Bson.dll + + ..\packages\MongoDB.Bson.2.0.1\lib\net45\MongoDB.Bson.dll + True - - False - ..\packages\mongocsharpdriver.1.10.0\lib\net35\MongoDB.Driver.dll + + ..\packages\MongoDB.Driver.2.0.1\lib\net45\MongoDB.Driver.dll + True + + + ..\packages\MongoDB.Driver.Core.2.0.1\lib\net45\MongoDB.Driver.Core.dll + True + + + ..\packages\mongocsharpdriver.2.0.1\lib\net45\MongoDB.Driver.Legacy.dll + True @@ -72,14 +83,12 @@ - - Designer - + - - {e2c4a7f9-4b14-46cb-bfce-afabfacb3390} - MongoRepository.Net40 + + {ce75b2fe-c027-42f6-8d00-e44cc38be7c7} + MongoRepository.Net45 diff --git a/MongoRepositoryTests/packages.config b/MongoRepositoryTests/packages.config index 2458748..17a61b0 100644 --- a/MongoRepositoryTests/packages.config +++ b/MongoRepositoryTests/packages.config @@ -1,4 +1,7 @@  - + + + + \ No newline at end of file