public void Handle(AccountRegisteredEvent @event) { if (AccountBalances.All(x => x.AccountId != @event.AccountId)) { AccountBalances.Add(new AccountBalance(@event.AccountId, @event.Name, @event.InitialBalance)); } }
public void Handle(AccountRegisteredEvent @event) { if (AccountInfos.All(x => x.AccountId != @event.AccountId)) { AccountInfos.Add(new AccountInfo(@event.AccountId, @event.Name, @event.Email)); } }
private void UpdateFrom(AccountRegisteredEvent @event) { Id = @event.AccountId; _balance = @event.InitialBalance; }
public void Apply(AccountRegisteredEvent aggregateEvent) { //throw new NotImplementedException(); }
public void Handle(AccountRegisteredEvent @event) { if (AccountInfos.All(x => x.AccountId != @event.AccountId)) AccountInfos.Add(new AccountInfo {AccountId = @event.AccountId}); }
public void Handle(AccountRegisteredEvent e) { Notifications.Add(new Notification(e.AccountId, string.Format("Account registered with initial balance of {0}.", e.InitialBalance))); }