Exemplo n.º 1
0
        /// <summary>
        /// Returns true if Level3SummaryData instances are equal
        /// </summary>
        /// <param name="other">Instance of Level3SummaryData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Level3SummaryData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DiscountAmount == other.DiscountAmount ||
                     DiscountAmount != null &&
                     DiscountAmount.Equals(other.DiscountAmount)
                     ) &&
                 (
                     DutyAmount == other.DutyAmount ||
                     DutyAmount != null &&
                     DutyAmount.Equals(other.DutyAmount)
                 ) &&
                 (
                     ShippingAmount == other.ShippingAmount ||
                     ShippingAmount != null &&
                     ShippingAmount.Equals(other.ShippingAmount)
                 ));
        }
Exemplo n.º 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 (DiscountAmount != null)
         {
             hashCode = hashCode * 59 + DiscountAmount.GetHashCode();
         }
         if (DutyAmount != null)
         {
             hashCode = hashCode * 59 + DutyAmount.GetHashCode();
         }
         if (ShippingAmount != null)
         {
             hashCode = hashCode * 59 + ShippingAmount.GetHashCode();
         }
         return(hashCode);
     }
 }