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); }
private void ApplyEvent(AggregateEvent @event) { ((dynamic)this).Apply((dynamic)@event); Version = @event.Version; }