public async Task EnactCommand(BankAccount target, DepositFunds command) { var created = new FundsDeposited { Amount = command.Amount }; target.RecordEvent(created); }
public void EnactCommand(DepositFunds command) { var created = new FundsDeposited { Amount = command.Amount }; RecordEvent(created); }
public void Apply(FundsDeposited @event) { var newTransaction = new Transaction { AccountNumber = @event.AccountNumber, Amount = @event.Amount }; Transactions.Add(newTransaction); CurrentBalance = CurrentBalance + @event.Amount; }