Example #1
0
        public override int GetHashCode()
        {
            var hash       = 13;
            var hashFactor = 7;

            hash = Id.GetHashCode(hash, hashFactor);
            hash = Artist.GetHashCode(hash, hashFactor);
            hash = Genre.GetHashCode(hash, hashFactor);
            hash = hash * hashFactor + Year.GetHashCode();
            hash = hash * hashFactor + Rating.GetHashCode();
            hash = hash * hashFactor + Starred.GetHashCode();
            hash = hash * hashFactor + AlbumArtSize.GetHashCode();
            hash = CoverArt.GetHashCode(hash, hashFactor);
            hash = hash * hashFactor + Child.GetHashCode();

            return(hash);
        }
Example #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (RoomId?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Message?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ IsBot.GetHashCode();
         hashCode = (hashCode * 397) ^ (CreatedBy?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ CreatedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ (EditedBy?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ EditedOn.GetHashCode();
         hashCode = (hashCode * 397) ^ IsBotMentioned.GetHashCode();
         hashCode = (hashCode * 397) ^ IsFromMyself.GetHashCode();
         hashCode = (hashCode * 397) ^ (Type?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Mentions.GetHashCode();
         hashCode = (hashCode * 397) ^ Starred.GetHashCode();
         return(hashCode);
     }
 }
Example #3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Athlete != null)
         {
             hashCode = hashCode * 59 + Athlete.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Distance != null)
         {
             hashCode = hashCode * 59 + Distance.GetHashCode();
         }
         if (ElevationGain != null)
         {
             hashCode = hashCode * 59 + ElevationGain.GetHashCode();
         }
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (IdStr != null)
         {
             hashCode = hashCode * 59 + IdStr.GetHashCode();
         }
         if (Map != null)
         {
             hashCode = hashCode * 59 + Map.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (_Private != null)
         {
             hashCode = hashCode * 59 + _Private.GetHashCode();
         }
         if (Starred != null)
         {
             hashCode = hashCode * 59 + Starred.GetHashCode();
         }
         if (Timestamp != null)
         {
             hashCode = hashCode * 59 + Timestamp.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (SubType != null)
         {
             hashCode = hashCode * 59 + SubType.GetHashCode();
         }
         if (CreatedAt != null)
         {
             hashCode = hashCode * 59 + CreatedAt.GetHashCode();
         }
         if (UpdatedAt != null)
         {
             hashCode = hashCode * 59 + UpdatedAt.GetHashCode();
         }
         if (EstimatedMovingTime != null)
         {
             hashCode = hashCode * 59 + EstimatedMovingTime.GetHashCode();
         }
         if (Segments != null)
         {
             hashCode = hashCode * 59 + Segments.GetHashCode();
         }
         return(hashCode);
     }
 }