public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CourseDate lesson = lessonB.FindLesson(id); if (lesson == null) { return(HttpNotFound()); } PopulateCourseDropDownList(lesson.CourseDateID); return(View(lesson)); }