Example #1
0
        /// <inheritdoc/>
        void IObserver <IEvent> .OnNext(IEvent evt)
        {
            var expectedVersion = _version + 1;

            if (evt.Version != expectedVersion)
            {
                throw new StreamEventOutOfOrderException(StringResources.AggregateSourceStreamProvidedEventOutOfOrder(expectedVersion, evt.Version));
            }

            Apply(evt);
            _version++;
        }