Ejemplo n.º 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
     });
 }
Ejemplo n.º 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
     });
 }
Ejemplo n.º 3
0
 public void OnWithdrawal(WithdrawalEvent evt)
 {
     Balance = new SimpleMoney(Balance.Amount - evt.Value.Amount);
 }
Ejemplo n.º 4
0
 public void OnDeposit(DepositEvent evt)
 {
     Balance = new SimpleMoney(Balance.Amount + evt.Value.Amount);
 }
Ejemplo n.º 5
0
 public Account()
 {
     Balance = new SimpleMoney(0);
 }
Ejemplo n.º 6
0
 public void OnWithdrawal(WithdrawalEvent evt)
 {
     Balance = new SimpleMoney(Balance.Amount - evt.Value.Amount);
 }
Ejemplo n.º 7
0
 public void OnDeposit(DepositEvent evt)
 {
     Balance = new SimpleMoney(Balance.Amount + evt.Value.Amount);
 }
Ejemplo n.º 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 });
 }
Ejemplo n.º 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 });
 }
Ejemplo n.º 10
0
 public  Account()
 {
     Balance = new SimpleMoney(0);
 }