Created
December 16, 2015 22:23
-
-
Save mizrael/7e75d7f14cb2971997fa to your computer and use it in GitHub Desktop.
basic C# interface for a MongoDB repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IRepository<TEntity> | |
{ | |
string CollectionName { get; } | |
Task<long> CountAsync(FilterDefinition<TEntity> filter); | |
IFindFluent<TEntity, TEntity> Find(FilterDefinition<TEntity> filter); | |
IFindFluent<TEntity, TEntity> Find(Expression<Func<TEntity, bool>> filter); | |
Task<TEntity> FindOneAndReplaceAsync(FilterDefinition<TEntity> filter, TEntity replacement); | |
Task<TEntity> FindOneAndReplaceAsync(Expression<Func<TEntity, bool>> filter, TEntity replacement); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment