// GET: Vehicles/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } //Vehicle vehicle = db.Vehicles.Find(id); Vehicle vehicle = _vehicleManager.GetById((int)id); if (vehicle == null) { return(HttpNotFound()); } return(View(vehicle)); }