Пример #1
0
        public ProjectionRepository(CronusContext context, IProjectionStore projectionStore, ISnapshotStore snapshotStore, ISnapshotStrategy snapshotStrategy, InMemoryProjectionVersionStore inMemoryVersionStore, IHandlerFactory handlerFactory, ProjectionHasher projectionHasher)
        {
            if (context is null)
            {
                throw new ArgumentException(nameof(context));
            }
            if (projectionStore is null)
            {
                throw new ArgumentException(nameof(projectionStore));
            }
            if (snapshotStore is null)
            {
                throw new ArgumentException(nameof(snapshotStore));
            }
            if (snapshotStrategy is null)
            {
                throw new ArgumentException(nameof(snapshotStrategy));
            }
            if (inMemoryVersionStore is null)
            {
                throw new ArgumentException(nameof(inMemoryVersionStore));
            }

            this.context              = context;
            this.projectionStore      = projectionStore;
            this.snapshotStore        = snapshotStore;
            this.snapshotStrategy     = snapshotStrategy;
            this.inMemoryVersionStore = inMemoryVersionStore;
            this.handlerFactory       = handlerFactory;
            this.projectionHasher     = projectionHasher;
        }
Пример #2
0
        public ProjectionRepository(IProjectionStore projectionStore, ISnapshotStore snapshotStore, ISnapshotStrategy snapshotStrategy, InMemoryProjectionVersionStore inMemoryVersionStore)
        {
            if (ReferenceEquals(null, projectionStore) == true)
            {
                throw new ArgumentException(nameof(projectionStore));
            }
            if (ReferenceEquals(null, snapshotStore) == true)
            {
                throw new ArgumentException(nameof(snapshotStore));
            }
            if (ReferenceEquals(null, snapshotStrategy) == true)
            {
                throw new ArgumentException(nameof(snapshotStrategy));
            }
            if (ReferenceEquals(null, inMemoryVersionStore) == true)
            {
                throw new ArgumentException(nameof(inMemoryVersionStore));
            }

            this.projectionStore      = projectionStore;
            this.snapshotStore        = snapshotStore;
            this.snapshotStrategy     = snapshotStrategy;
            this.inMemoryVersionStore = inMemoryVersionStore;
        }