public void EnrollInCourse(Course course) { if (this.EnrolledCourses.ContainsKey(course.GetName())) { throw new DuplicateEntryInStructureException(this.UserName, course.GetName()); } this.enrolledCourses.Add(course.GetName(), course); }
public int CompareTo(Course other) => string.Compare(this.Name, other.GetName(), StringComparison.Ordinal);