コード例 #1
0
ファイル: EventStore.cs プロジェクト: jackyzhou/ZSharp
 public EventStore(
     IEventBus eventBus,
     IDomainEventRepository <T> domainEventRepo,
     ISnapshotRepository <T> snapshotRepo,
     ISnapshotPolicy snapshotPlicy)
 {
     this.eventBus        = eventBus;
     this.snapshotRepo    = snapshotRepo;
     this.domainEventRepo = domainEventRepo;
     this.snapshotPlicy   = snapshotPlicy;
 }
コード例 #2
0
 /// <summary>
 /// Parameterized constructor.
 /// </summary>
 public EventSourcedRepository(IEventStore eventStore,
     ISnapshotStore snapshotStore,
     ISnapshotPolicy snapshotPolicy,
     IMemoryCache cache,
     IEventBus eventBus,
     IAggregateRootFactory aggregateFactory,
     IBinarySerializer binarySerializer)
 {
     this._eventStore = eventStore;
     this._snapshotStore = snapshotStore;
     this._snapshotPolicy = snapshotPolicy;
     this._cache = cache;
     this._eventBus = eventBus;
     this._aggregateFactory = aggregateFactory;
     this._binarySerializer = binarySerializer;
     //this._textSerializer = textSerializer;
     this._logger = LogManager.GetLogger("ThinkNet");
 }
 public void AddPolicy(AggregateRootType eventProviderType, ISnapshotPolicy snapshotPolicy)
 {
     Contract.Requires(eventProviderType != null);
     Contract.Requires(snapshotPolicy != null);
     Contract.Ensures(GetPolicy(eventProviderType) == snapshotPolicy);
 }