public ActionResult DeleteProject(int id) { Project project = model.Projects.SingleOrDefault(p => p.ID == id); if (project == null) { return(View("NotFound")); } ViewData["DeletedProject"] = project.Title; model.DeleteObject(project); model.SaveChanges(); return(View("Deleted")); }