public static Course getCourse(int courseNo) { Course course = new Course(); BasicStudentDbContext db = new BasicStudentDbContext(); course = db.courses.Find(courseNo); return(course); }
public static CourseSection getCourseAndSections(int?id) { BasicStudentDbContext db = new BasicStudentDbContext(); CourseSection courseSection = new CourseSection(); courseSection.course = db.courses.Find(id); var sections = db.sections.Where(s => s.courseNumber == courseSection.course.courseNumber); courseSection.sections = sections.ToList(); return(courseSection); }