Ejemplo n.º 1
0
        public long Count(Expression <Func <T, bool> > filter, ISnapshotCollection snapshot = null)
        {
            var collection = GetCollectionSnapOrNon(snapshot);
            var result     = collection.CountDocuments(filter);

            return(result);
        }
Ejemplo n.º 2
0
 public MongoDbAggregateSnapshotter(
     ISnapshotCollection snapshotCollection,
     IAggregateSnapshotSerializer aggregateSnapshotSerializer,
     ILoggerFactory loggerFactory,
     ITypeNameProvider typeNameProvider
     )
 {
     _snapshotCollection          = snapshotCollection;
     _aggregateSnapshotSerializer = aggregateSnapshotSerializer;
     _logger           = loggerFactory.Create(GetType().FullName);
     _typeNameProvider = typeNameProvider;
 }
Ejemplo n.º 3
0
        private IMongoCollection <T> GetCollectionSnapOrNon(ISnapshotCollection snapshot)
        {
            IMongoCollection <T> collection;

            if (snapshot == null)
            {
                collection = this.OriginalCollection;
            }
            else
            {
                collection = this.GetSnapCollection(snapshot.SnapshotName);
            }
            return(collection);
        }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
        public IFindFluent <T, T> Find(FilterDefinition <T> filter, ISnapshotCollection snapshot = null)
        {
            var collection = GetCollectionSnapOrNon(snapshot);

            return(collection.Find(filter));
        }
Ejemplo n.º 8
0
        public IFindFluent <T, T> Find(Expression <Func <T, bool> > filter, ISnapshotCollection snapshot = null)
        {
            var collection = GetCollectionSnapOrNon(snapshot);

            return(collection.Find(filter));
        }