public void RemoveCourse(Course courseToRemove) { bool courseIsFound = this.CourseExists(courseToRemove); if (!courseIsFound) { throw new ArgumentException("No such course found"); } this.courses.Remove(courseToRemove); }
private bool CourseExists(Course courseToCheck) { bool isFound = false; foreach (var course in this.courses) { if (courseToCheck.CourseName == course.CourseName) { isFound = true; } } return isFound; }
public void AddCourse(Course courseToAdd) { this.courses.Add(courseToAdd); }