public void Handle(DepositRecorded @event) { var projection = _projectionStore.GetProjection(@event.ToCustomerId); projection.Accounts.Single(a => a.AccountId == @event.Transfer.ToAccountId.ToString()).Balance += @event.Transfer.Amount; _projectionStore.Save(@event.ToCustomerId, projection); }
public void When(DepositRecorded e) { Balance += e.Transfer.Amount; }
public void DepositAmount(Guid fromCustomerId, string fromAccount, double amount) { var @event = new DepositRecorded(fromCustomerId, CustomerId, Id, fromAccount, amount, DateTime.Now); Append(@event); }