public IActionResult Add() { ProductViewModel viewModel = new ProductViewModel(); Result <List <CategoryDO> > categoryList = _categoryBL.GetAll(); if (categoryList.IsSuccess) { viewModel.CategoryList = categoryList.Data; } return(View(viewModel)); }
public async Task <IActionResult> List(int id = 0) { if (id != 0) { Result <List <CategoryDO> > result = _categoryBL.GetSubCategoriesById(id); result.Html = await PartialView("_List", result).ToString(ControllerContext); return(Json(result)); } else { Result <List <CategoryDO> > result = _categoryBL.GetAll(); result.Html = await PartialView("_List", result).ToString(ControllerContext); return(Json(result)); } }
public IActionResult Get() { return(Ok(_categoryBL.GetAll())); }