public ActionResult Delete(int id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Book book = db.Book.Find(id); if (book == null) { return HttpNotFound(); } return View(book); }