Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void PopulateAssignedCourseData(Instructor instructor)
- {
- var allCourses = db.Courses;
- var instructorCourses = new HashSet<int>(instructor.Courses.Select(c =>
- c.CourseID));
- var viewModel = new List<AssignedCourseData>();
- foreach (var course in allCourses)
- {
- viewModel.Add(new AssignedCourseData
- {
- 198
- CourseID = course.CourseID,
- Title = course.Title,
- Assigned = instructorCourses.Contains(course.CourseID)
- });
- }
- ViewBag.Courses = viewModel;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement