コード例 #1
0
        protected void ApplyEvent(InvoiceDomainEvent domainEvent)
        {
            switch (domainEvent)
            {
            case InvoiceCreatedEvent invoiceCreatedEvent:
                Id = invoiceCreatedEvent.InvoiceId;
                State.AccountId = invoiceCreatedEvent.AccountId;
                break;

            case InvoiceSummaryAddedEvent InvoiceSummaryAddedEvent:
                break;
            }
        }
コード例 #2
0
 public void AddEvent(InvoiceDomainEvent domainEvent)
 {
     ApplyEvent(domainEvent);
     UncommittedEvents.Add(domainEvent);
     StreamVersion++;
 }