public IEnumerable <Course> GetDependentCourses(Courses courses) { var dependentCourseNames = this.GetDependentCourseNames().ToList().Select(t => courses[t]); return(dependentCourseNames); }
/// <summary> /// We can follow the Mediator pattern if we inject an abstract Mediator class instead of the Courses repository. /// </summary> /// <param name="courses"></param> public void Save(Courses courses) { courses.AddCourse(this); }
public IEnumerable <int> GetDependentCourseIDs(Courses courses) { var dependentCourseNames = this.GetDependentCourseNames().ToList().Select(t => courses.GetCourseIdFromName(t)); return(dependentCourseNames); }