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); }
public void When(WitdrawalRecorded e) { Balance -= e.Transfer.Amount; }
public void WithdrawAmount(Guid toCustomerId, string toAccount, double amount) { var @event = new WitdrawalRecorded(CustomerId, toCustomerId, toAccount, Id, amount, DateTime.Now); Append(@event); }