alexandre-spieser / mongodb-generic-repository

An example of generic repository implementation using the MongoDB C# Sharp 2.0 driver (async)
MIT License
315 stars 87 forks source link

Add read operation support for filter definition #42

Closed khanhna closed 2 years ago

khanhna commented 3 years ago

Overview

This PR add some read operation using native FilterDefinition of MongoDriver for C#.

Do we need that ?

As far as I enjoy this package for a while, things became a bit more complex when it comes to make use of some advance filter options support from mongodb (like collation, strength, batch size, disk using,..) that I usually do by inherit to make my own repository with some extra operation methods.

But I found that pretty cumbersome working with multiple project, I do have to copy and paste those code all over around. So, how about support them right on the root package ?

Sound good for me, but I don't know if that considerable adding to the root package. I was intended to add all CRUD operations but this PR just add some read operations (let me know if I should implement the rest CRUD operations).

Testing

Due to the current testing implement install nuget package, I made another branch to implement the test over some newly added operation. If this PR was merge, I'll make another PR for those later. The branch was here

alexandre-spieser commented 3 years ago

Hello @khanhna thanks for the PR! I will have a look and get back to you :)

alexandre-spieser commented 2 years ago

All good cheers. Please add the tests :)