public ActionResult Edit(int id = 0) { var allCategories = from c in db.Categorys select c; ViewBag.cate = allCategories; Book book = db.Books.Find(id); if (book == null) { return HttpNotFound(); } return View(book); }