Example #1
0
 public void AddEvent(IDomainEvent domainDomain, bool isUncommitted = true)
 {
     ApplyEvent(domainDomain);
     DomainEvents.Add(domainDomain);
     if (isUncommitted)
     {
         var eventData = new EventData(Guid.NewGuid(), domainDomain.EventType,
                                       true, domainDomain.GetBytes(), GetMetaData());
         UncommittedEvents.Add(eventData);
     }
     else
     {
         OriginalVersion++;
     }
     UncommittedVersion++;
 }