예제 #1
0
        public void EnrollInCourse(Course course)
        {
            if (this.EnrolledCourses.ContainsKey(course.GetName()))
            {
                throw new DuplicateEntryInStructureException(this.UserName, course.GetName());
            }

            this.enrolledCourses.Add(course.GetName(), course);
        }
예제 #2
0
 public int CompareTo(Course other) => string.Compare(this.Name, other.GetName(), StringComparison.Ordinal);