public ActionResult Update(UpdateArticleCategoryView model) { try { var entity = _unitOfWork.ArticleCategoryRepository.GetById(model.Id); Mapper.Map(entity, model); return(View(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public ActionResult UpdatePost(UpdateArticleCategoryView model) { if (ModelState.IsValid) { try { var entity = Mapper.Map <ArticleCategory>(model); _unitOfWork.ArticleCategoryRepository.Update(entity); _unitOfWork.Save(); return(RedirectToAction("Index")); } catch (Exception ex) { throw new Exception(ex.Message); } } return(View()); }