GH.MongoDb.GenericRepository 3.0.0

dotnet add package GH.MongoDb.GenericRepository --version 3.0.0
NuGet\Install-Package GH.MongoDb.GenericRepository -Version 3.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GH.MongoDb.GenericRepository" Version="3.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GH.MongoDb.GenericRepository --version 3.0.0
#r "nuget: GH.MongoDb.GenericRepository, 3.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install GH.MongoDb.GenericRepository as a Cake Addin
#addin nuget:?package=GH.MongoDb.GenericRepository&version=3.0.0

// Install GH.MongoDb.GenericRepository as a Cake Tool
#tool nuget:?package=GH.MongoDb.GenericRepository&version=3.0.0

Generic MongoDb Repository .Net Core 3.0

Synopsis

Is an repository pattern implementation for mongodb. It contains abstract classes for CRUD operations.

Code Example

You must create classes derived from IDocument and the repositories derived from GenericRepositoryAsync or GenericBucketRepositoryAsync or GenericGeoRepositoryAsync:

public class Person: IDocument<ObjectId>
    {
	    public ObjectId Id {get; set;}
	    public string FirstName {get; set;}
	    public string LastName {get; set;}
    }

public sealed class PeopleRepositoryAsync:GenericRepositoryAsync<Person, ObjectId>
{
    public PeopleRepositoryAsync(IMongoDbConnector connector) : base(connector, "people")
    {
    }
}

"people" is collection name. then you can use repository:

var myConnector = new MongoDbConnector("localhost", "mydatabase")
var myRepo = new PeopleRepositoryAsync(myConnector)

myRepo.Get() //return all people in my collection 
myRepo.Get(myID) //return person with myID as id
myRepo.Get(p=> p.FirstName == "John") //return all people who have name john

and so on..

Installation

by NUGET

Install-Package GH.MongoDb.GenericRepository -Version 2.0.7

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on GH.MongoDb.GenericRepository:

Package Downloads
GH.MongoDb.GenericRepository.BucketExtension

Add GridFs features to GH.MongoDb.GenericRepository

GH.MongoDb.GenericRepository.GeoExtension

Add Geographic query extension to GH.MongoDb.GenericRepository

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.0 2,644 12/25/2017
2.0.7 1,811 10/25/2017
2.0.6 1,831 10/24/2017
2.0.5 1,892 10/24/2017
2.0.4 1,875 10/23/2017
2.0.3 1,853 10/19/2017
2.0.2 1,778 10/18/2017
2.0.1 1,919 10/6/2017
2.0.0 1,964 9/11/2017
1.0.1 2,084 9/9/2017
1.0.0 1,863 9/9/2017