예제 #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Id != null ? Id.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Text != null ? Text.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ImageUrl != null ? ImageUrl.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CreatedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ (ButtonTitle != null ? ButtonTitle.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ButtonAction != null ? ButtonAction.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Author != null ? Author.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CommentsCount;
         hashCode = (hashCode * 397) ^ LikesCount;
         hashCode = (hashCode * 397) ^ IsLikedByMe.GetHashCode();
         hashCode = (hashCode * 397) ^ StickyStart.GetHashCode();
         hashCode = (hashCode * 397) ^ StickyEnd.GetHashCode();
         hashCode = (hashCode * 397) ^ (Mentions != null ? Mentions.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FeedId != null ? FeedId.GetHashCode() : 0);
         return(hashCode);
     }
 }
        private bool Equals(ActivityPost other)
        {
#pragma warning disable 0618
            return(string.Equals(Id, other.Id) && string.Equals(Text, other.Text) && string.Equals(ImageUrl, other.ImageUrl) && CreatedAt.Equals(other.CreatedAt) &&
                   string.Equals(ButtonTitle, other.ButtonTitle) && string.Equals(ButtonAction, other.ButtonAction) && Equals(Action, other.Action) && Equals(Author, other.Author) &&
                   CommentsCount == other.CommentsCount && LikesCount == other.LikesCount && IsLikedByMe == other.IsLikedByMe && StickyStart.Equals(other.StickyStart) &&
                   StickyEnd.Equals(other.StickyEnd) && Mentions.ListEquals(other.Mentions) && string.Equals(FeedId, other.FeedId));

#pragma warning restore 0618
        }