Пример #1
0
        public void RemoveCourse(Course courseToRemove)
        {
            bool courseIsFound = this.CourseExists(courseToRemove);

            if (!courseIsFound)
            {
                throw new ArgumentException("No such course found");
            }

            this.courses.Remove(courseToRemove);
        }
Пример #2
0
        private bool CourseExists(Course courseToCheck)
        {
            bool isFound = false;

            foreach (var course in this.courses)
            {
                if (courseToCheck.CourseName == course.CourseName)
                {
                    isFound = true;
                }
            }

            return isFound;
        }
Пример #3
0
 public void AddCourse(Course courseToAdd)
 {
     this.courses.Add(courseToAdd);
 }