Inheritance: IDomainEvent
コード例 #1
0
        public void When(ClientPassedAway @event)
        {
            try
            {
                AccountNumber accountNumber = accountNumberService.GetAccountNumberForClient(@event.ClientId);

                if (accountNumber.IsEmpty())
                {
                    return;
                }

                Account account = accountRepository.Get(accountNumber);
                account.Cancel();
                accountRepository.Save(account);
                unitOfWork.Commit();
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }
        }
コード例 #2
0
ファイル: ClientState.cs プロジェクト: AdrianFreemantle/DDD
 void IHandleClientStateTransitions.When(ClientPassedAway @event)
 {
     isDeceased = true;
 }
コード例 #3
0
 public void When(ClientPassedAway @event)
 {
     var clientView = FetchClientView(@event.ClientId);
     clientView.IsDeceased = true;
 }
コード例 #4
0
 public void When(ClientPassedAway @event)
 {
     var clientModel = FetchModel(@event.ClientId);
     clientModel.IsDeceased = true;
     Logger.Verbose(@event.ToString());
 }