public ActionResult DelCourse(int ID) { using (var ctx = new CSEntities()) { ctx.DelCourse(ID); return(RedirectToAction("Courses", "Home")); } }