示例#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 (CategoryId != null)
         {
             hashCode = hashCode * 59 + CategoryId.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Info != null)
         {
             hashCode = hashCode * 59 + Info.GetHashCode();
         }
         if (CategoryItems != null)
         {
             hashCode = hashCode * 59 + CategoryItems.GetHashCode();
         }
         if (Buy != null)
         {
             hashCode = hashCode * 59 + Buy.GetHashCode();
         }
         if (Sell != null)
         {
             hashCode = hashCode * 59 + Sell.GetHashCode();
         }
         return(hashCode);
     }
 }