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