Ejemplo n.º 1
0
 public void Credit(Money money)
 {
     _state.Balance += money.Amount;
     var @event = new AccountCreditedEvent(Id, _state.Balance, money.Amount);
     _accountBalanceCreditedEventListeners.ForEach(l => l.Handle(@event));
 }
 public void Handle(AccountCreditedEvent @event)
 {
     _repository.SaveAccountBalance(new AccountBalance { Id = @event.AggregateId, Balance = @event.Balance });
 }