public void Deposit(Deposit deposit) { if (!IsAccountOpen) { throw new ApplicationException("Account is not open"); } var depositedEvent = new AmountDepositedEvent( deposit.DepositId, deposit.Amount, deposit.Date, deposit.AccountId); ApplyChange(depositedEvent); }
private void Apply(AmountDepositedEvent @event) { CurrentBalance += @event.Amount; }