public async Task Deposit(decimal amount, string description) { if (amount < 0) { throw new ArgumentException("Invalid Amount"); } await Rebuild(); var @event = new Deposit2Event() { AccountID = ID, Amount = amount, Description = description }; await Append(@event); }
public Task Handle(Deposit2Event @event) { //Handles events from aggregate but this domain doesn't do anything with them return(Task.CompletedTask); }
protected void Apply(Deposit2Event @event) { Balance += @event.Amount; LastTransactionDescription = @event.Description; LastTransactionAmount = @event.Amount; }