예제 #1
0
 private Company(CompanyId id, OwnerId ownerId, string name, DateTime setUpDate, CompanyContact companyContact, IList <Agency> agenciess)
 {
     this.Id             = id;
     this.OwnerId        = ownerId;
     this.setUpDate      = setUpDate;
     this.agencies       = agenciess;
     this.companyContact = companyContact;
     this.agencies       = agenciess ?? new List <Agency>();
 }
예제 #2
0
 public void ChangeContact(CompanyContact companyContact)
 {
     this.companyContact = companyContact;
 }
예제 #3
0
        public static Company Create(CompanyId id, OwnerId ownerId, string name, DateTime setUpDate, CompanyContact companyContact, IList <Agency> agencies = null)
        {
            if (agencies.Count > 10)
            {
                throw new CreateCompanyRejectedException("Company cannot contains more than 10 Agencies");
            }

            return(new Company(id, ownerId, name, setUpDate, companyContact, agencies));
        }