public ActionResult Delete(int id, writer writer4) { writer movie = db.writers.Find(id); if (movie == null) { return HttpNotFound(); } db.writers.Remove(movie); db.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Create(writer writer2) { try { if (ModelState.IsValid) { db.writers.Add(writer2); db.SaveChanges(); return RedirectToAction("Index"); } else { return View(); } } catch { return View(); } }
public ActionResult Edit(int id, writer writer3) { try { if (ModelState.IsValid) { db.Entry(writer3).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } else { return View(); } } catch { return View(); } }