Ru.GameSchool.DataLayer.Repository.Course.FixupCourseGrades C# (CSharp) Method

FixupCourseGrades() private method

private FixupCourseGrades ( object sender, NotifyCollectionChangedEventArgs e ) : void
sender object
e System.Collections.Specialized.NotifyCollectionChangedEventArgs
return void
        private void FixupCourseGrades(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                foreach (CourseGrade item in e.NewItems)
                {
                    item.Course = this;
                }
            }
    
            if (e.OldItems != null)
            {
                foreach (CourseGrade item in e.OldItems)
                {
                    if (ReferenceEquals(item.Course, this))
                    {
                        item.Course = null;
                    }
                }
            }
        }