Ru.GameSchool.DataLayer.Repository.CommentLike.FixupComment C# (CSharp) Méthode

FixupComment() private méthode

private FixupComment ( Comment previousValue ) : void
previousValue Comment
Résultat void
        private void FixupComment(Comment previousValue)
        {
            if (previousValue != null && previousValue.CommentLikes.Contains(this))
            {
                previousValue.CommentLikes.Remove(this);
            }
    
            if (Comment != null)
            {
                if (!Comment.CommentLikes.Contains(this))
                {
                    Comment.CommentLikes.Add(this);
                }
                if (CommentId != Comment.CommentId)
                {
                    CommentId = Comment.CommentId;
                }
            }
        }