Example #1
0
 public void Withdrawal(SimpleMoney value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value", "Value is required to perform a deposit");
     }
     if (Balance.Amount < value.Amount)
     {
         throw new NsfException("Insufficient Funds");
     }
     Apply(new WithdrawalEvent {
         AggregateRootId = Id, Value = value
     });
 }
Example #2
0
 public void Deposit(SimpleMoney value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("value", "Value is required to perform a deposit");
     }
     if (value.Amount <= 0)
     {
         throw new ArgumentException("Money amounts must be greater than zero");
     }
     Apply(new DepositEvent {
         AggregateRootId = Id, Value = value
     });
 }
Example #3
0
 public void OnWithdrawal(WithdrawalEvent evt)
 {
     Balance = new SimpleMoney(Balance.Amount - evt.Value.Amount);
 }
Example #4
0
 public void OnDeposit(DepositEvent evt)
 {
     Balance = new SimpleMoney(Balance.Amount + evt.Value.Amount);
 }
Example #5
0
 public Account()
 {
     Balance = new SimpleMoney(0);
 }
Example #6
0
 public void OnWithdrawal(WithdrawalEvent evt)
 {
     Balance = new SimpleMoney(Balance.Amount - evt.Value.Amount);
 }
Example #7
0
 public void OnDeposit(DepositEvent evt)
 {
     Balance = new SimpleMoney(Balance.Amount + evt.Value.Amount);
 }
Example #8
0
 public void Withdrawal(SimpleMoney value)
 {
     if (value == null) throw new ArgumentNullException("value", "Value is required to perform a deposit");
     if (Balance.Amount < value.Amount) throw new NsfException("Insufficient Funds");
     Apply(new WithdrawalEvent { AggregateRootId = Id, Value = value });
 }
Example #9
0
 public void Deposit(SimpleMoney value)
 {
     if (value == null) throw new ArgumentNullException("value", "Value is required to perform a deposit");
     if (value.Amount <= 0) throw new ArgumentException("Money amounts must be greater than zero");
     Apply(new DepositEvent { AggregateRootId = Id, Value = value });
 }
Example #10
0
 public  Account()
 {
     Balance = new SimpleMoney(0);
 }