Skip to content

Instantly share code, notes, and snippets.

@jbogard
Last active January 13, 2020 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbogard/2a2fe2a05182ac44d6803ff90c0536b1 to your computer and use it in GitHub Desktop.
Save jbogard/2a2fe2a05182ac44d6803ff90c0536b1 to your computer and use it in GitHub Desktop.
public interface IDocumentRepository<T> where T : IAggregate {
// we expose IMongoQueryable directly because it has Mongo-specific methods
IMongoQueryable<T> Query();
Task<T> Get(Guid id);
Task Save(T document);
Task Update(T document, Expression<Func<T, bool>> filter);
Task Update(T document);
IMongoCollection<T> Collection { get; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment