public ActionResult EditComment(Comment comment) { if (ModelState.IsValid) { _blogUnitOf.Comment.Update(comment); _blogUnitOf.Save(); return RedirectToAction("ViewAPost", "Post", new { id= comment.PostId }); } return View(); }
public ActionResult CreateComment(Int64 id, Comment comment) { if (ModelState.IsValid) { comment.DateCreate = DateTime.Now; comment.PostId = id; _blogUnitOf.Comment.Add(comment); _blogUnitOf.Save(); return RedirectToAction("ViewAPost", "Post", new {id}); } return View(); }