public ActionResult DeleteConfirmed(int id) { H2HComment h2HComment = db.H2HComments.Find(id); db.H2HComments.Remove(h2HComment); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Text")] H2HComment h2HComment) { if (ModelState.IsValid) { db.Entry(h2HComment).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(h2HComment)); }
public ActionResult Create([Bind(Include = "Id,Text")] H2HComment h2HComment) { if (ModelState.IsValid) { db.H2HComments.Add(h2HComment); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(h2HComment)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } H2HComment h2HComment = db.H2HComments.Find(id); if (h2HComment == null) { return(HttpNotFound()); } return(View(h2HComment)); }