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