public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Category category = _categorysService.Find(id); if (category == null) { return(HttpNotFound()); } CategorysViewModel categorysViewModel = Mapper.Map <CategorysViewModel>(category); return(View(categorysViewModel)); }
public ActionResult Index(Guid?id) { if (id == null) { return(RedirectToAction("Index", "Home")); } var category = _categorysService.Find(id.Value); if (category == null) { return(HttpNotFound()); } var categoryViewModel = AutoMapper.Mapper.Map <CategorysViewModel>(category); ViewBag.IdCategory = id.Value; return(View(categoryViewModel)); }