Example #1
0
        public static IApplyEventsInternal From <TState>(IApplyEvents <TState> publicApplier)
        {
            var stateType = typeof(TState);

            return(new FunctionalInternalApplier((s, e) => publicApplier.Apply((TState)s, e),
                                                 (s, e) => s == stateType && publicApplier.CanApplyEvent(e)));
        }
Example #2
0
        /// <summary>
        /// Initializes a new instance of <see cref="AggregateStore"/> using the specified <paramref name="settings"/>.
        /// </summary>
        internal AggregateStore(IApplyEvents aggregateUpdater, IStoreSnapshots snapshotStore, IStoreEvents eventStore, IStoreAggregateSettings settings)
        {
            Verify.NotNull(settings, nameof(settings));
            Verify.NotNull(eventStore, nameof(eventStore));
            Verify.NotNull(snapshotStore, nameof(snapshotStore));
            Verify.NotNull(aggregateUpdater, nameof(aggregateUpdater));

            this.snapshotInterval = settings.SnapshotInterval;
            this.aggregateUpdater = aggregateUpdater;
            this.snapshotStore    = snapshotStore;
            this.eventStore       = eventStore;
        }
        /// <summary>
        /// Initializes a new instance of <see cref="AggregateStore"/> using the specified <paramref name="settings"/>.
        /// </summary>
        internal AggregateStore(IApplyEvents aggregateUpdater, IStoreSnapshots snapshotStore, IStoreEvents eventStore, IStoreAggregateSettings settings)
        {
            Verify.NotNull(settings, nameof(settings));
            Verify.NotNull(eventStore, nameof(eventStore));
            Verify.NotNull(snapshotStore, nameof(snapshotStore));
            Verify.NotNull(aggregateUpdater, nameof(aggregateUpdater));

            this.snapshotInterval = settings.SnapshotInterval;
            this.aggregateUpdater = aggregateUpdater;
            this.snapshotStore = snapshotStore;
            this.eventStore = eventStore;
        }
 public IManuallyConfigureEventAppliers WithEventApplier <TState>(IApplyEvents <TState> stateApplier)
 => WithEventApplier(typeof(TState), stateApplier);
Example #5
0
 /// <summary>
 /// Initializes a new instance of <see cref="AggregateStore"/>.
 /// </summary>
 public AggregateStore(IApplyEvents aggregateUpdater, IStoreSnapshots snapshotStore, IStoreEvents eventStore)
     : this(aggregateUpdater, snapshotStore, eventStore, Settings.Default.AggregateStore)
 {
 }
 /// <summary>
 /// Initializes a new instance of <see cref="AggregateStore"/>.
 /// </summary>
 public AggregateStore(IApplyEvents aggregateUpdater, IStoreSnapshots snapshotStore, IStoreEvents eventStore)
     : this(aggregateUpdater, snapshotStore, eventStore, Settings.Default.AggregateStore)
 {
 }