Example #1
0
        protected void RaiseEvent(AggregateEvent @event)
        {
            if (@event is null)
            {
                throw new ArgumentException($"{nameof(@event)} cannot be null");
            }

            @event.Version = Version + 1;
            ApplyEvent(@event);
            _uncommittedEvents.Add(@event);
        }
Example #2
0
 private void ApplyEvent(AggregateEvent @event)
 {
     ((dynamic)this).Apply((dynamic)@event);
     Version = @event.Version;
 }