Ejemplo n.º 1
0
 private async Task RaiseEvents(IAggregateRoot aggregate)
 {
     foreach (var @event in aggregate.GetUncommitedEvents())
     {
         await _eventBus.Publish(@event);
     }
 }
        private int CalculateExpectedVersion(IAggregateRoot aggregateRoot)
        {
            var expectedVersion = aggregateRoot.Version - aggregateRoot.GetUncommitedEvents().Count;

            return(expectedVersion);
        }