예제 #1
0
        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);
        }
예제 #2
0
 private void Apply(AmountDepositedEvent @event)
 {
     CurrentBalance += @event.Amount;
 }