Пример #1
0
        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;
                }
            }
        }
Пример #2
0
        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;
                }
            }
        }