コード例 #1
0
        public IEnumerable <Course> GetDependentCourses(Courses courses)
        {
            var dependentCourseNames = this.GetDependentCourseNames().ToList().Select(t => courses[t]);

            return(dependentCourseNames);
        }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
        public IEnumerable <int> GetDependentCourseIDs(Courses courses)
        {
            var dependentCourseNames = this.GetDependentCourseNames().ToList().Select(t => courses.GetCourseIdFromName(t));

            return(dependentCourseNames);
        }