public IActionResult GetAllSubCategories() { try { return(Ok(GetSubCategories(subCategoryBLL.GetAll().Data))); } catch (Exception ex) { return(NotFound(ex)); } }
CompanyVM GetCompanyVM(Company company = null) { CompanyVM companyVM = new CompanyVM(); foreach (SubCategory item in SubCategoryBLL.GetAll().Data) { companyVM.SubCategories.Add(new SelectListItem { Text = item.CategoryName, Value = item.ID.ToString() }); } if (company != null) { companyVM.CompanyName = company.CompanyName; companyVM.Overview = company.Overview; companyVM.WebSite = company.WebSite; companyVM.Location = company.Location; companyVM.SubCatID = company.SubCategoryID; } return(companyVM); }