public ActionResult Delete(short? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } Department department = db.Departments.Find(id); if (department == null) { return HttpNotFound(); } return View(department); }