コード例 #1
0
 public void Handle(AccountRegisteredEvent @event)
 {
     if(AccountInfos.All(x => x.AccountId != @event.AccountId))
         AccountInfos.Add(new AccountInfo(@event.AccountId,
             @event.Name,
             @event.Email));
 }
コード例 #2
0
 public void Handle(AccountRegisteredEvent @event)
 {
     if(AccountBalances.All(x=>x.AccountId != @event.AccountId))
         AccountBalances.Add(new AccountBalance(@event.AccountId,
             @event.Name,
             @event.InitialBalance));
 }
コード例 #3
0
ファイル: Account.cs プロジェクト: rlasjunies/CQRS_trial
 private void UpdateFrom(AccountRegisteredEvent @event)
 {
     Id = @event.AccountId;
     _balance = @event.InitialBalance;
 }
コード例 #4
0
 public void Handle(AccountRegisteredEvent e)
 {
     Notifications.Add(new Notification(e.AccountId, string.Format("Account registered with initial balance of {0}.", e.InitialBalance)));
 }