Esempio n. 1
0
        public void Handle(DepositMoney c)
        {
            var aggregate = _repository.Get <AccountAggregate>(c.AggregateIdentifier);

            aggregate.DepositMoney(c.Amount, c.Transaction);
            Commit(aggregate);
        }
Esempio n. 2
0
        public void Handle(MoneyWithdrawn e)
        {
            if (e.Transaction == Guid.Empty)
            {
                return;
            }

            var status = new UpdateTransfer(e.Transaction, "Debit Succeeded");

            _commander.Send(status);

            var transfer = (Transfer)_repository.Get <TransferAggregate>(e.Transaction).State;

            var deposit = new DepositMoney(transfer.ToAccount, e.Amount, e.Transaction);

            _commander.Send(deposit);
        }