public CompanyModel ToModel(Company company) { CompanyModel companyModel = new CompanyModel(); companyModel.CompanyFunctionID = company.companyfunctionid; companyModel.CompanyName = company.companyname; companyModel.CompanyNumber = company.companynumber; companyModel.CompanyTypeID = company.companytypeid; companyModel.ID = company.id; // companyModel.SubcontractorTypes = company.subcontactors.SubContractorTypeIDs; companyModel.Products = company.products != null?productMapper.ToModelList(company.products) : null; companyModel.CompanyFunction = company.companyfunction != null?companyFunctionMapper.ToModel(company.companyfunction) : null; return(companyModel); }
public List <ProductModel> GetByCompanyID(int companyID) { return(productMapper.ToModelList(productRepository.GetByCompanyID(companyID))); }