Skip to content

Instantly share code, notes, and snippets.

@jbogard
Last active January 13, 2020 15:21
Show Gist options
  • Select an option

  • Save jbogard/2a2fe2a05182ac44d6803ff90c0536b1 to your computer and use it in GitHub Desktop.

Select an option

Save jbogard/2a2fe2a05182ac44d6803ff90c0536b1 to your computer and use it in GitHub Desktop.

Revisions

  1. jbogard revised this gist Jan 13, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions IMongoRepository.cs
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    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; }
    }
  2. jbogard created this gist Jan 13, 2020.
    7 changes: 7 additions & 0 deletions IMongoRepository.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    public interface IDocumentRepository<T> where T : IAggregate {
    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);
    }