Ejemplo n.º 1
0
        public void Handle(WitdrawalRecorded @event)
        {
            var projection = _projectionStore.GetProjection(@event.FromCustomerId);

            projection.Accounts.Single(a => a.AccountId == @event.Transfer.FromAccountId.ToString()).Balance -= @event.Transfer.Amount;
            _projectionStore.Save(@event.FromCustomerId, projection);
        }
Ejemplo n.º 2
0
 public void When(WitdrawalRecorded e)
 {
     Balance -= e.Transfer.Amount;
 }
Ejemplo n.º 3
0
        public void WithdrawAmount(Guid toCustomerId, string toAccount, double amount)
        {
            var @event = new WitdrawalRecorded(CustomerId, toCustomerId, toAccount, Id, amount, DateTime.Now);

            Append(@event);
        }