public IActionResult Index() { var subcategories = _subcategoryRepo.GetAllSubcategories(); ViewBag.Title = "Subcategory"; ViewBag.TitlePlural = "Subcategories"; return(View(subcategories)); }
public HttpResponseMessage GetAllSubcategories(int CatId) { var subcategories = _subcategoryRepository.GetAllSubcategories(CatId); if (subcategories == null) { return(Request.CreateErrorResponse(HttpStatusCode.NoContent, "Subcategory doesn't exist")); } return(Request.CreateResponse(HttpStatusCode.OK, subcategories)); }
public ActionResult <List <SubcategoryViewModel> > GetAllSubcategories() { return(_subcategoryRepository.GetAllSubcategories()); }