public void Apply(CashWithdrawnEvent @event)
 {
     Balance -= @event.Amount;
     if (Balance < 0 && Math.Abs(Balance) > OverdraftLimit)
     {
         AccountState = Enumerations.AccountState.Blocked;
     }
 }
コード例 #2
0
ファイル: ActiveAccount.cs プロジェクト: mesteves/CQRS
 private void onWithdrawl(CashWithdrawnEvent cashWithdrawnEvent)
 {
     _ledgers.Add(new DebitMutation(cashWithdrawnEvent.Amount, new AccountNumber(string.Empty)));
     _balance = cashWithdrawnEvent.Balance;
 }