public ActionResult GetCategory(string Id) { CategoryViewModel model; if (!string.IsNullOrEmpty(Id)) { var res = _categoryMasterService.GetCategory(Convert.ToDecimal(Id)); model = AutoMapper.Mapper.Map <CategoryMaster, CategoryViewModel>(res); } else { model = new CategoryViewModel(); } return(PartialView("AddEditCategory", model)); }