public ActionResult Delete(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Laptop laptop = db.Laptops.Find(id); if (laptop == null) { return HttpNotFound(); } return View(laptop); }