Ejemplo 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 (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (MerchantLinenumber != null)
         {
             hashCode = hashCode * 59 + MerchantLinenumber.GetHashCode();
         }
         if (MerchantPagenumber != null)
         {
             hashCode = hashCode * 59 + MerchantPagenumber.GetHashCode();
         }
         if (NrOfItems != null)
         {
             hashCode = hashCode * 59 + NrOfItems.GetHashCode();
         }
         if (PricePerItem != null)
         {
             hashCode = hashCode * 59 + PricePerItem.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns true if LineItemInvoiceData instances are equal
        /// </summary>
        /// <param name="other">Instance of LineItemInvoiceData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(LineItemInvoiceData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                     ) &&
                 (
                     MerchantLinenumber == other.MerchantLinenumber ||
                     MerchantLinenumber != null &&
                     MerchantLinenumber.Equals(other.MerchantLinenumber)
                 ) &&
                 (
                     MerchantPagenumber == other.MerchantPagenumber ||
                     MerchantPagenumber != null &&
                     MerchantPagenumber.Equals(other.MerchantPagenumber)
                 ) &&
                 (
                     NrOfItems == other.NrOfItems ||
                     NrOfItems != null &&
                     NrOfItems.Equals(other.NrOfItems)
                 ) &&
                 (
                     PricePerItem == other.PricePerItem ||
                     PricePerItem != null &&
                     PricePerItem.Equals(other.PricePerItem)
                 ));
        }