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