{"repo":"alexandre-spieser/mongodb-generic-repository","free":true,"listed":false,"github":"https://github.com/alexandre-spieser/mongodb-generic-repository","clone":"git clone https://github.com/alexandre-spieser/mongodb-generic-repository.git","description":"An example of generic repository implementation using the MongoDB C# Sharp 2.0 driver (async)","language":"C#","stars":322,"topics":["generic","mongodb","repository"],"license":"MIT","category":"data-pipelines","readme_excerpt":"MongoDbGenericRepository An example of generic repository implementation using the MongoDB C# Sharp 2.0 (and now 3. ) driver (async) Now available as a nuget package: https://www.nuget.org/packages/MongoDbGenericRepository/ Covered by 400+ integration tests and counting. The MongoDbGenericRepository is also used in AspNetCore.Identity.MongoDbCore. Support This Project If you have found this project helpful, either as a library that you use or as a learning tool, please consider buying Alex a coffee: Worth Knowing This package sets the MongoDefaults.GuidRepresentation to MongoDB.Bson.GuidRepresentation.Standard by default, instead of the default driver setting of MongoDB.Bson.GuidRepresentation.CSharpLegacy . This can cause issues if you have been using the driver on an existing application previously or if you are using CosmosDB. You can override this behaviour to enforce legacy behaviour in your app Startup routine like so : MongoDbContext.SetGuidRepresentation(MongoDB.Bson.GuidRepresentation.CSharpLegacy) . More info here. Usage examples This repository is meant to be inherited from. You are responsible for managing its lifetime, it is advised to setup this repository as a singleton. Here is an example of repository usage, where the TestRepository is implementing 2 custom methods: If all your documents have the same type of Id , you can use the more specific BaseMongoRepository where TKey is the type of the Id of your documents. Instantiation The repository can be instantia","default_branch":null,"files":null,"tree":[],"storefront":"/r/alexandre-spieser","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/alexandre-spieser/mongodb-generic-repository/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}