Beispiel #1
0
        public void Apply(DomainEvents.AddAccount e)
        {
            var acct = Accounts.Find(a => a.AccountNumber.Equals(e.Account.AccountNumber));

            if (acct == null)
            {
                Accounts.Add(e.Account);
            }
        }
Beispiel #2
0
        public bool CanApply(DomainEvents.AddAccount @event)
        {
            if (string.IsNullOrWhiteSpace(@event.Account.AccountNumber))
            {
                throw new DomainValidationException("Account Number not provided to Add Account.");
            }

            return(true);
        }