public bool CanApply(DomainEvents.CreateCustomer @event) { if (@event.MailingAddress == null) { throw new DomainValidationException("Mailing Address not provided to Create Customer."); } else if (@event.PrimaryAccountHolder == null) { throw new DomainValidationException("Primary Account Holder not provided to Create Customer."); } return(true); }
public void Apply(DomainEvents.CreateCustomer e) { PrimaryAccountHolder = e.PrimaryAccountHolder; MailingAddress = e.MailingAddress; }