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 (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (MinQty != null)
         {
             hashCode = hashCode * 59 + MinQty.GetHashCode();
         }
         if (MaxQty != null)
         {
             hashCode = hashCode * 59 + MaxQty.GetHashCode();
         }
         if (QtyStep != null)
         {
             hashCode = hashCode * 59 + QtyStep.GetHashCode();
         }
         if (PipSize != null)
         {
             hashCode = hashCode * 59 + PipSize.GetHashCode();
         }
         if (PipValue != null)
         {
             hashCode = hashCode * 59 + PipValue.GetHashCode();
         }
         if (MinTick != null)
         {
             hashCode = hashCode * 59 + MinTick.GetHashCode();
         }
         if (LotSize != null)
         {
             hashCode = hashCode * 59 + LotSize.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (Category == null ? 0 : Category.GetHashCode());
         hash = hash * 23 + (Description == null ? 0 : Description.GetHashCode());
         hash = hash * 23 + (DiscountPct == default(decimal) ? 0 : DiscountPct.GetHashCode());
         hash = hash * 23 + (EndDate == default(DateTime) ? 0 : EndDate.GetHashCode());
         hash = hash * 23 + (MaxQty == null ? 0 : MaxQty.GetHashCode());
         hash = hash * 23 + (MinQty == default(int) ? 0 : MinQty.GetHashCode());
         hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode());
         hash = hash * 23 + (Rowguid == default(Guid) ? 0 : Rowguid.GetHashCode());
         hash = hash * 23 + (StartDate == default(DateTime) ? 0 : StartDate.GetHashCode());
         hash = hash * 23 + (Type == null ? 0 : Type.GetHashCode());
         return(hash);
     }
 }