public void Apply(DomainEvents.AddAccount e) { var acct = Accounts.Find(a => a.AccountNumber.Equals(e.Account.AccountNumber)); if (acct == null) { Accounts.Add(e.Account); } }
public bool CanApply(DomainEvents.AddAccount @event) { if (string.IsNullOrWhiteSpace(@event.Account.AccountNumber)) { throw new DomainValidationException("Account Number not provided to Add Account."); } return(true); }