private void FixupCourse(Course previousValue) { if (previousValue != null && ReferenceEquals(previousValue.OnlineCourse, this)) { previousValue.OnlineCourse = null; } if (Course != null) { Course.OnlineCourse = this; if (CourseID != Course.CourseID) { CourseID = Course.CourseID; } } }
private void FixupCourse(Course previousValue) { if (previousValue != null && previousValue.StudentGrades.Contains(this)) { previousValue.StudentGrades.Remove(this); } if (Course != null) { if (!Course.StudentGrades.Contains(this)) { Course.StudentGrades.Add(this); } if (CourseID != Course.CourseID) { CourseID = Course.CourseID; } } }