Пример #1
0
        public Task EstablishCreditWhen(NewAccountCreated command)
        {
            _log.AddResult("Account Handler was Called.");

            if (command.AccountNumber == null)
            {
                throw new InvalidOperationException("Account number can't be null.");
            }

            return(Task.Delay(5));
        }
Пример #2
0
        public void MailLastCatalogWhen(NewAccountCreated domainEvent)
        {
            _log.AddResult("Mailing Handler Called.");

            if (domainEvent.AccountNumber == null)
            {
                throw new InvalidOperationException("Catalog count not be mailed.");
            }

            if (domainEvent.FirstName != null && domainEvent.FirstName == "Sam")
            {
                Console.WriteLine("Sam's Club Catalog");
            }
        }