public ActionResult DeleteConfirmed(int id) { authorTable authorTable = db.authorTables.Find(id); db.authorTables.Remove(authorTable); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "authorId,firstName,lastName,age,country")] authorTable authorTable) { if (ModelState.IsValid) { db.Entry(authorTable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(authorTable)); }
public ActionResult Create([Bind(Include = "authorId,firstName,lastName,age,country")] authorTable authorTable) { if (ModelState.IsValid) { db.authorTables.Add(authorTable); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(authorTable)); }
// GET: authorTables/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } authorTable authorTable = db.authorTables.Find(id); if (authorTable == null) { return(HttpNotFound()); } return(View(authorTable)); }