Esempio n. 1
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 (ContentType != null)
         {
             hashCode = hashCode * 59 + ContentType.GetHashCode();
         }
         if (ContentUrl != null)
         {
             hashCode = hashCode * 59 + ContentUrl.GetHashCode();
         }
         if (Content != null)
         {
             hashCode = hashCode * 59 + Content.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (ThumbnailUrl != null)
         {
             hashCode = hashCode * 59 + ThumbnailUrl.GetHashCode();
         }
         return(hashCode);
     }
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Returns HashCode</returns>
 public override int GetHashCode()
 {
     return(String.Format("{0}|{1}|{2}|{3}|",
                          EntityId?.GetHashCode() ?? 0,
                          ContentUrl?.GetHashCode() ?? 0,
                          RemoveUrl?.GetHashCode() ?? 0,
                          WebsiteUrl?.GetHashCode() ?? 0
                          ).GetHashCode());
 }
Esempio n. 3
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = base.GetHashCode();
                hashCode = (hashCode * 397) ^ (string.IsNullOrEmpty(FileName) ? 0 : FileName.GetHashCode());
                hashCode = (hashCode * 397) ^ FileSize.GetHashCode();
                hashCode = (hashCode * 397) ^ (string.IsNullOrEmpty(ContentType) ? 0 : ContentType.GetHashCode());
                hashCode = (hashCode * 397) ^ (Author == null ? 0 : Author.GetHashCode());
                hashCode = (hashCode * 397) ^ (CreatedOn == null ? 0 : CreatedOn.Value.GetHashCode());
                hashCode = (hashCode * 397) ^ (string.IsNullOrEmpty(Description) ? 0 : Description.GetHashCode());
                hashCode = (hashCode * 397) ^ (string.IsNullOrEmpty(ContentUrl) ? 0 : ContentUrl.GetHashCode());

                return(hashCode);
            }
        }