public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Company com = companyManager.Find(x => x.Id == id); if (com == null) { return(HttpNotFound()); } return(View(com)); }