Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Bind to legacy driver #11

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions MongoRepository.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>MongoRepository</id>
<title>MongoRepository</title>
<version>1.6.8</version>
<version>1.7.0</version>
<authors>tgeek, RobIII</authors>
<owners>tgeek</owners>
<licenseUrl>http://mongorepository.codeplex.com/license</licenseUrl>
Expand All @@ -13,21 +13,18 @@
<tags>mongo mongodb repository</tags>
<iconUrl>http://download-codeplex.sec.s-msft.com/Download?ProjectName=mongorepository&amp;DownloadId=334950&amp;Build=19692</iconUrl>
<releaseNotes>
Updated to MongoCSharp driver 1.10
Updated to MongoCSharp legacy driver 2.0
Removed support for net3.5 and net4.0
</releaseNotes>
<summary>
Provides a repository pattern on top of 10gen's MongoDB C# driver.
</summary>
<language>en-US</language>
<dependencies>
<dependency id="mongocsharpdriver" version="[1.10]" />
<dependency id="mongocsharpdriver" version="[2.0]" />
</dependencies>
</metadata>
<files>
<file src="\MongoRepository\bin\Release\MongoRepository.Net35.dll" target="lib\net35" />
<file src="\MongoRepository\bin\Release\MongoRepository.Net35.XML" target="lib\net35" />
<file src="\MongoRepository\bin\Release\MongoRepository.Net40.dll" target="lib\net40" />
<file src="\MongoRepository\bin\Release\MongoRepository.Net40.XML" target="lib\net40" />
<file src="\MongoRepository\bin\Release\MongoRepository.Net45.dll" target="lib\net45" />
<file src="\MongoRepository\bin\Release\MongoRepository.Net45.XML" target="lib\net45" />
<file src="\MongoRepository\app.config.transform" target="content" />
Expand Down
16 changes: 2 additions & 14 deletions MongoRepository.sln
Original file line number Diff line number Diff line change
@@ -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}"
Expand All @@ -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
Expand All @@ -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
Expand Down
83 changes: 0 additions & 83 deletions MongoRepository/MongoRepository.Net35.csproj

This file was deleted.

84 changes: 0 additions & 84 deletions MongoRepository/MongoRepository.Net40.csproj

This file was deleted.

20 changes: 14 additions & 6 deletions MongoRepository/MongoRepository.Net45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,21 @@
<DocumentationFile>bin\Release\MongoRepository.Net45.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="MongoDB.Bson, Version=1.9.1.221, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Bson.dll</HintPath>
<Reference Include="MongoDB.Bson, Version=2.0.1.27, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MongoDB.Bson.2.0.1\lib\net45\MongoDB.Bson.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MongoDB.Driver, Version=1.9.1.221, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Driver.dll</HintPath>
<Reference Include="MongoDB.Driver, Version=2.0.1.27, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MongoDB.Driver.2.0.1\lib\net45\MongoDB.Driver.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MongoDB.Driver.Core, Version=2.0.1.27, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MongoDB.Driver.Core.2.0.1\lib\net45\MongoDB.Driver.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MongoDB.Driver.Legacy, Version=2.0.1.27, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\mongocsharpdriver.2.0.1\lib\net45\MongoDB.Driver.Legacy.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
30 changes: 0 additions & 30 deletions MongoRepository/Repository/IRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,36 +94,6 @@ public interface IRepository<T, TKey> : IQueryable<T>
/// <param name="predicate">The expression.</param>
/// <returns>True when an entity matching the predicate exists, false otherwise.</returns>
bool Exists(Expression<Func<T, bool>> predicate);

/// <summary>
/// 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).
/// </summary>
/// <returns>A helper object that implements IDisposable and calls RequestDone() from the Dispose method.</returns>
/// <remarks>
/// 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.
/// </remarks>
IDisposable RequestStart();

/// <summary>
/// Lets the server know that this thread is done with a series of related operations.
/// </summary>
/// <remarks>
/// Instead of calling this method it is better to put the return value of RequestStart in a using statement.
/// </remarks>
void RequestDone();
}

/// <summary>
Expand Down
45 changes: 0 additions & 45 deletions MongoRepository/Repository/MongoRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,51 +235,6 @@ public virtual bool Exists(Expression<Func<T, bool>> predicate)
return this.collection.AsQueryable<T>().Any(predicate);
}

/// <summary>
/// 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).
/// </summary>
/// <returns>A helper object that implements IDisposable and calls RequestDone() from the Dispose method.</returns>
/// <remarks>
/// <para>
/// 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.
/// </para>
/// <para>
/// 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.
/// </para>
/// <para>
/// 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
/// </para>
/// </remarks>
public virtual IDisposable RequestStart()
{
return this.collection.Database.RequestStart();
}

/// <summary>
/// Lets the server know that this thread is done with a series of related operations.
/// </summary>
/// <remarks>
/// Instead of calling this method it is better to put the return value of RequestStart in a using statement.
/// </remarks>
public virtual void RequestDone()
{
this.collection.Database.RequestDone();
}

#region IQueryable<T>
/// <summary>
/// Returns an enumerator that iterates through a collection.
Expand Down
Loading