Beispiel #1
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>
 /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = CouponCode.GetHashCode();
         hashCode = (hashCode * 397) ^ DiscountId;
         return(hashCode);
     }
 }
Beispiel #2
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 (CouponCode != null)
         {
             hashCode = hashCode * 59 + CouponCode.GetHashCode();
         }
         if (TotalDiscountAmount != null)
         {
             hashCode = hashCode * 59 + TotalDiscountAmount.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #3
0
 public override int GetHashCode()
 {
     return(CouponCode?.GetHashCode() ?? 0);
 }
Beispiel #4
0
 public override int GetHashCode()
 {
     return(CouponCode.GetHashCode());
 }