public ActionResult EditPost(EditPostViewModel model) { try { //if (!ModelState.IsValid) return View(model); var post = _managerPost.GetPostById(model.ID); post.description = model.Description; _managerPost.Update(post); return RedirectToAction("MyPage", "Profile"); } catch (Exception) { return View(); } }
public ActionResult EditPost(EditPostViewModel model, long numPost) { if (!ModelState.IsValid) return View(model); var post = _managerPost.GetPostById(numPost); model = Mapper.Map<Post, EditPostViewModel>(post); return View(model); }