/// <summary>
        /// Returns true if StatementBase instances are equal
        /// </summary>
        /// <param name="other">Instance of StatementBase to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StatementBase other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     PublishDate == other.PublishDate ||
                     PublishDate != null &&
                     PublishDate.Equals(other.PublishDate)
                 ) &&
                 (
                     StatDate == other.StatDate ||
                     StatDate != null &&
                     StatDate.Equals(other.StatDate)
                 ));
        }
Exemple #2
0
        public override bool Equals(object obj)
        {
            Game game = obj as Game;

            if (game == null)
            {
                return(false);
            }
            bool b = GameName == game.GameName &&
                     Publisher == game.Publisher &&
                     Country == game.Country &&
                     PublishDate.Equals(game.PublishDate);

            if (game.GenreList == null || !GenreList.Count.Equals(game.GenreList.Count))
            {
                return(false);
            }
            if (b)
            {
                List <Genre> list1 = new List <Genre>(GenreList.OrderBy(i => i.IDGenre));
                List <Genre> list2 = new List <Genre>(game.GenreList.OrderBy(i => i.IDGenre));
                for (int i = 0; i < list1.Count(); i++)
                {
                    b = list1[i].IDGenre.Equals(list2[i].IDGenre);
                }
            }
            else
            {
                return(false);
            }
            return(b);
        }
Exemple #3
0
        public override bool Equals(object obj)
        {
            Comment comment = obj as Comment;

            if (comment == null)
            {
                return(false);
            }
            return(Nickname == comment.Nickname &&
                   Email == comment.Email &&
                   CommentContent.Trim() == comment.CommentContent.Trim() &&
                   CommentedGameRefID == comment.CommentedGameRefID &&
                   PublishDate.Equals(PublishDate));
        }
Exemple #4
0
        private bool Equals(Article other)
        {
            bool authorsEquals = Authors.Count == other.Authors.Count;

            if (!authorsEquals)
            {
                return(false);
            }

            for (int i = 0; i < Authors.Count; i++)
            {
                authorsEquals = Authors[i].Equals(other.Authors[i]);
                if (!authorsEquals)
                {
                    return(false);
                }
            }

            return(string.Equals(Id, other.Id) && string.Equals(Source, other.Source) && string.Equals(Subject, other.Subject) &&
                   string.Equals(Title, other.Title) && PublishDate.Equals(other.PublishDate) && LastUpdateTime.Equals(other.LastUpdateTime) &&
                   Content.Equals(other.Content) && authorsEquals && string.Equals(Summary, other.Summary));
        }