public IActionResult GetSubCategories(int id) { var subCategoriesDto = _subCategoryManager.GetSubCategories(id); var subCategoriesVm = _viewModelMapper.Map(subCategoriesDto); return(Json(new SelectList(subCategoriesVm, "Id", "Name"))); }
//GET - EDIT public IActionResult Edit(int?id) { if (id == null) { return(NotFound()); } var menuItemDto = _menuItemManager.GetMenuItem(id); var subCategoryDto = _subCategoryManager.GetSubCategories(menuItemDto.CategoryId); var categoriesListDto = _categoryManager.GetAllCategories(); menuItemAndSubCListAndCListVm.MenuItem = _viewModelMapper.Map(menuItemDto); menuItemAndSubCListAndCListVm.SubCategoriesList = _viewModelMapper.Map(subCategoryDto); menuItemAndSubCListAndCListVm.CategoriesList = _viewModelMapper.Map(categoriesListDto); return(View(menuItemAndSubCListAndCListVm)); }
public HttpResponseMessage GetSubCategories(SubCategorySearchFilter subCategorySearchFilter) { Result <SubCategoryDto> result = subCategoryManager.GetSubCategories(subCategorySearchFilter); return(Request.CreateResponse <Result <SubCategoryDto> >(HttpStatusCode.OK, result)); }