// GET: Admin/Category public ActionResult Index() { var res = _categoryMasterService.GetCategoryList().ToList(); var viewModel = AutoMapper.Mapper.Map <List <CategoryMaster>, List <CategoryViewModel> >(res); return(View(viewModel)); }
public ActionResult GetSubCategory(string Id) { SubCategoryViewModel model; if (!string.IsNullOrEmpty(Id)) { var res = _subCategoryService.GetSubCategory(Convert.ToDecimal(Id)); model = AutoMapper.Mapper.Map <SubCategoryMaster, SubCategoryViewModel>(res); } else { model = new SubCategoryViewModel(); } ViewBag.CategoryList = _categoryMasterService.GetCategoryList(); return(PartialView("AddEditSubCategory", model)); }