public long Count(Expression <Func <T, bool> > filter, ISnapshotCollection snapshot = null) { var collection = GetCollectionSnapOrNon(snapshot); var result = collection.CountDocuments(filter); return(result); }
public MongoDbAggregateSnapshotter( ISnapshotCollection snapshotCollection, IAggregateSnapshotSerializer aggregateSnapshotSerializer, ILoggerFactory loggerFactory, ITypeNameProvider typeNameProvider ) { _snapshotCollection = snapshotCollection; _aggregateSnapshotSerializer = aggregateSnapshotSerializer; _logger = loggerFactory.Create(GetType().FullName); _typeNameProvider = typeNameProvider; }
private IMongoCollection <T> GetCollectionSnapOrNon(ISnapshotCollection snapshot) { IMongoCollection <T> collection; if (snapshot == null) { collection = this.OriginalCollection; } else { collection = this.GetSnapCollection(snapshot.SnapshotName); } return(collection); }
public SavableMongoDbAggregateSnapshotter( IAggregateSnapshotConfiguration aggregateSnapshotConfiguration, ISnapshotCollection snapshotCollection, IAggregateSnapshotSerializer aggregateSnapshotSerializer, IRepository repository, ILoggerFactory loggerFactory, ITypeNameProvider typeNameProvider ) { _aggregateSnapshotConfiguration = aggregateSnapshotConfiguration; _snapshotCollection = snapshotCollection; _aggregateSnapshotSerializer = aggregateSnapshotSerializer; _repository = repository; _logger = loggerFactory.Create(GetType().FullName); _typeNameProvider = typeNameProvider; }
public MongoDbAggregateSnapshotStore(ISnapshotCollection snapshotCollection) { _snapshotCollection = snapshotCollection; }
public void Page <TKey>(int pageIndex, int pageSize, Expression <Func <T, TKey> > orderBy, bool isOrderByAsc = true, Expression <Func <T, bool> > where = null, ISnapshotCollection snapshot = null) { var collection = GetCollectionSnapOrNon(snapshot); var repo = new MongoRepository <T>(collection); var result = repo.Pagination(pageIndex, pageSize, orderBy, isOrderByAsc, where); }
public IFindFluent <T, T> Find(FilterDefinition <T> filter, ISnapshotCollection snapshot = null) { var collection = GetCollectionSnapOrNon(snapshot); return(collection.Find(filter)); }
public IFindFluent <T, T> Find(Expression <Func <T, bool> > filter, ISnapshotCollection snapshot = null) { var collection = GetCollectionSnapOrNon(snapshot); return(collection.Find(filter)); }