Example #1
0
 public Customer(CustomerName name, Email primaryEmail, Maybe <Email> secondaryEmail, Industry industry)
     : this()
 {
     _name            = name;
     _primaryEmail    = primaryEmail;
     SecondaryEmail   = secondaryEmail;
     EmailingSettings = new EmailingSettings(industry, false);
     Status           = CustomerStatus.Regular;
 }
Example #2
0
        public Customer(CustomerName name, Email primaryEmail, Maybe <Email> secondaryEmail, Industry industry)
            : this()
        {
            _name            = name;
            _primaryEmail    = primaryEmail;
            SecondaryEmail   = secondaryEmail;
            EmailingSettings = new EmailingSettings(industry, false);
            Status           = CustomerStatus.Regular;

            AddDomainEvent(new NameIndustryChangedEvent("Evento de dominio!"));
        }
Example #3
0
        public Customer(CustomerName name, Email primaryEmail, Maybe <Email> secondaryEmail, Industry industry)
            : this()
        {
            //if (name == null)
            //    throw new ArgumentNullException(nameof(name));
            //if (primaryEmail == null)
            //    throw new ArgumentNullException(nameof(primaryEmail));
            //if (industry == null)
            //    throw new ArgumentNullException(nameof(industry));

            //null guard should inject it

            _name            = name;
            _primaryEmail    = primaryEmail;
            SecondaryEmail   = secondaryEmail;
            EmailingSettings = new EmailingSettings(industry, false);
            Status           = CustomerStatus.Regular;
        }
Example #4
0
 public virtual void UpdateIndustry(Industry industry)
 {
     EmailingSettings = EmailingSettings.ChangeIndustry(industry);
 }
Example #5
0
 public virtual void DisableEmailing()
 {
     EmailingSettings = EmailingSettings.DisableEmailing();
 }