public void Handle(AccountDebitedEvent @event)
        {
            var account = AccountBalances.FirstOrDefault(x => x.AccountId == @event.AccountId);

            if(account != null)
                account.Debit(@event.Amount);
        }
Example #2
0
 private void UpdateFrom(AccountDebitedEvent @event)
 {
     _balance = @event.NewBalance;
 }
 public void Handle(AccountDebitedEvent e)
 {
     Notifications.Add(new Notification(e.AccountId, string.Format("Debited {0}.", e.Amount)));
 }