// GET: SubMenuMaster/Details/5 public ActionResult Details(int?id) { try { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var subMenu = _subMenu.GetSubMenuById(id); var subMenuMaster = AutoMapper.Mapper.Map <SubMenuMasterViewModel>(subMenu); var menuMaster = _menu.GetMenuById(subMenuMaster.MenuId); subMenuMaster.MenuName = menuMaster.MenuName; return(View(subMenuMaster)); } catch (Exception) { throw; } }