public IActionResult Add()
        {
            ProductViewModel            viewModel    = new ProductViewModel();
            Result <List <CategoryDO> > categoryList = _categoryBL.GetAll();

            if (categoryList.IsSuccess)
            {
                viewModel.CategoryList = categoryList.Data;
            }
            return(View(viewModel));
        }
Example #2
0
        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));
            }
        }
Example #3
0
 public IActionResult Get()
 {
     return(Ok(_categoryBL.GetAll()));
 }