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>();
 }
 public void ChangeContact(CompanyContact companyContact)
 {
     this.companyContact = companyContact;
 }
        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));
        }