public ActionResult DeleteConfirmed(int id) { BookVote bookVote = db.BookVotes.Find(id); db.BookVotes.Remove(bookVote); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id")] BookVote bookVote) { if (ModelState.IsValid) { db.Entry(bookVote).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bookVote)); }
public ActionResult Create([Bind(Include = "Id")] BookVote bookVote) { if (ModelState.IsValid) { db.BookVotes.Add(bookVote); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bookVote)); }
// GET: BookVotes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BookVote bookVote = db.BookVotes.Find(id); if (bookVote == null) { return(HttpNotFound()); } return(View(bookVote)); }