private IPersistence CreatePersistence(Type owner, TKey key, HandleEvent?applyEvent) { Guard.NotNull(key); var snapshotStore = GetSnapshotStore <None>(); return(new Persistence <TKey>(key, owner, eventStore, eventEnricher, eventDataFormatter, snapshotStore, streamNameResolver, applyEvent)); }
internal BatchPersistence(DomainId ownerKey, BatchContext <T> context, long version, IReadOnlyList <Envelope <IEvent> > @events, HandleEvent?applyEvent) { this.ownerKey = ownerKey; this.context = context; this.events = events; this.applyEvent = applyEvent; Version = version; }
public Persistence(TKey ownerKey, Type ownerType, IEventStore eventStore, IEventDataFormatter eventDataFormatter, ISnapshotStore <None, TKey> snapshotStore, IStreamNameResolver streamNameResolver, HandleEvent?applyEvent) : base(ownerKey, ownerType, eventStore, eventDataFormatter, snapshotStore, streamNameResolver, PersistenceMode.EventSourcing, null, applyEvent) { }
public Persistence(TKey ownerKey, Type ownerType, IEventStore eventStore, IEventEnricher <TKey> eventEnricher, IEventDataFormatter eventDataFormatter, ISnapshotStore <TSnapshot, TKey> snapshotStore, IStreamNameResolver streamNameResolver, PersistenceMode persistenceMode, HandleSnapshot <TSnapshot>?applyState, HandleEvent?applyEvent) { this.ownerKey = ownerKey; this.ownerType = ownerType; this.applyState = applyState; this.applyEvent = applyEvent; this.eventStore = eventStore; this.eventEnricher = eventEnricher; this.eventDataFormatter = eventDataFormatter; this.persistenceMode = persistenceMode; this.snapshotStore = snapshotStore; this.streamNameResolver = streamNameResolver; }
private IPersistence <T> CreatePersistence(Type owner, DomainId key, PersistenceMode mode, HandleSnapshot <T>?applySnapshot, HandleEvent?applyEvent) { Guard.NotNull(key, nameof(key)); return(new Persistence <T>(key, owner, snapshotStore, eventStore, eventDataFormatter, streamNameResolver, mode, applySnapshot, applyEvent)); }
public IPersistence <T> WithSnapshotsAndEventSourcing(Type owner, DomainId key, HandleSnapshot <T>?applySnapshot, HandleEvent?applyEvent) { return(CreatePersistence(owner, key, PersistenceMode.SnapshotsAndEventSourcing, applySnapshot, applyEvent)); }
public IPersistence <T> WithEventSourcing(Type owner, DomainId key, HandleEvent?applyEvent) { return(CreatePersistence(owner, key, PersistenceMode.EventSourcing, null, applyEvent)); }
private IPersistence <TState> CreatePersistence <TState>(Type owner, TKey key, PersistenceMode mode, HandleSnapshot <TState>?applySnapshot, HandleEvent?applyEvent) { Guard.NotNull(key); var snapshotStore = GetSnapshotStore <TState>(); return(new Persistence <TState, TKey>(key, owner, eventStore, eventEnricher, eventDataFormatter, snapshotStore, streamNameResolver, mode, applySnapshot, applyEvent)); }
public IPersistence <TState> WithSnapshotsAndEventSourcing <TState>(Type owner, TKey key, HandleSnapshot <TState>?applySnapshot, HandleEvent?applyEvent) { return(CreatePersistence(owner, key, PersistenceMode.SnapshotsAndEventSourcing, applySnapshot, applyEvent)); }
public IPersistence WithEventSourcing(Type owner, TKey key, HandleEvent?applyEvent) { return(CreatePersistence(owner, key, applyEvent)); }