Ru.GameSchool.DataLayer.Repository.LevelExamAnswer.FixupLevelExamQuestion C# (CSharp) Method

FixupLevelExamQuestion() private method

private FixupLevelExamQuestion ( LevelExamQuestion previousValue ) : void
previousValue LevelExamQuestion
return void
        private void FixupLevelExamQuestion(LevelExamQuestion previousValue)
        {
            if (previousValue != null && previousValue.LevelExamAnswers.Contains(this))
            {
                previousValue.LevelExamAnswers.Remove(this);
            }
    
            if (LevelExamQuestion != null)
            {
                if (!LevelExamQuestion.LevelExamAnswers.Contains(this))
                {
                    LevelExamQuestion.LevelExamAnswers.Add(this);
                }
                if (LevelExamQuestionId != LevelExamQuestion.LevelExamQuestionId)
                {
                    LevelExamQuestionId = LevelExamQuestion.LevelExamQuestionId;
                }
            }
        }