public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Project project = db.Projects.Find(id); if (project == null) { return(HttpNotFound()); } ViewBag.Archived = project.Archived; if (projectsHelper.AnyOpenTickets((int)id)) { ViewBag.OpenTickets = "This project has open/unresolved tickets!"; } return(View(project)); }