Example #1
0
            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);
        }
Example #3
0
        public void Apply(FundsDeposited @event)
        {
            var newTransaction = new Transaction {
                AccountNumber = @event.AccountNumber, Amount = @event.Amount
            };

            Transactions.Add(newTransaction);
            CurrentBalance = CurrentBalance + @event.Amount;
        }