Beispiel #1
0
        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);
        }
Beispiel #2
0
 public Task Handle(Deposit2Event @event)
 {
     //Handles events from aggregate but this domain doesn't do anything with them
     return(Task.CompletedTask);
 }
Beispiel #3
0
 protected void Apply(Deposit2Event @event)
 {
     Balance += @event.Amount;
     LastTransactionDescription = @event.Description;
     LastTransactionAmount      = @event.Amount;
 }