public ActionResult EditCourse(int courseId) { CourseInfo courseInfo = dao.GetCourseInfo(courseId); courseInfo.CourseOptions = dao.GetAllCourses() .Where(c => c.CourseId != courseId) .Select(c => new CourseOption { CourseId = c.CourseId, CourseCode = c.CourseCode }) .ToList(); courseInfo.PrereqIds = courseInfo.Prereqs?.Select(p => p.courseId).ToList(); return(View(courseInfo)); }