public ActionResult Create(Comment comment) { if (ModelState.IsValid) { db.Comments.Add(comment); db.SaveChanges(); return RedirectToAction("ArticleFull", "Article", new { id = comment.ArticleID }); } return View("ArticleFull", "Article", new { id = comment.ArticleID }); }
public ActionResult Edit(Comment comment) { if (ModelState.IsValid) { db.Entry(comment).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("ArticleFull", "Article", new { id = comment.ArticleID }); } return View(comment); }