예제 #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 (ProductReviewID != null)
         {
             hashCode = hashCode * 59 + ProductReviewID.GetHashCode();
         }
         if (ProductId != null)
         {
             hashCode = hashCode * 59 + ProductId.GetHashCode();
         }
         if (ReviewerName != null)
         {
             hashCode = hashCode * 59 + ReviewerName.GetHashCode();
         }
         if (ReviewDate != null)
         {
             hashCode = hashCode * 59 + ReviewDate.GetHashCode();
         }
         if (EmailAddress != null)
         {
             hashCode = hashCode * 59 + EmailAddress.GetHashCode();
         }
         if (Rating != null)
         {
             hashCode = hashCode * 59 + Rating.GetHashCode();
         }
         if (Comments != null)
         {
             hashCode = hashCode * 59 + Comments.GetHashCode();
         }
         return(hashCode);
     }
 }