Exemple #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 (ReferenceNumber != null)
         {
             hashCode = hashCode * 59 + ReferenceNumber.GetHashCode();
         }
         if (ItemNumber != null)
         {
             hashCode = hashCode * 59 + ItemNumber.GetHashCode();
         }
         if (Quantity != null)
         {
             hashCode = hashCode * 59 + Quantity.GetHashCode();
         }
         if (DispositionType != null)
         {
             hashCode = hashCode * 59 + DispositionType.GetHashCode();
         }
         if (DispositionInstructions != null)
         {
             hashCode = hashCode * 59 + DispositionInstructions.GetHashCode();
         }
         if (Labels != null)
         {
             hashCode = hashCode * 59 + Labels.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #2
0
        /// <summary>
        /// Returns true if ReturnAuthorizationReturnDispositions instances are equal
        /// </summary>
        /// <param name="other">Instance of ReturnAuthorizationReturnDispositions to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ReturnAuthorizationReturnDispositions other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ReferenceNumber == other.ReferenceNumber ||
                     ReferenceNumber != null &&
                     ReferenceNumber.Equals(other.ReferenceNumber)
                     ) &&
                 (
                     ItemNumber == other.ItemNumber ||
                     ItemNumber != null &&
                     ItemNumber.Equals(other.ItemNumber)
                 ) &&
                 (
                     Quantity == other.Quantity ||
                     Quantity != null &&
                     Quantity.Equals(other.Quantity)
                 ) &&
                 (
                     DispositionType == other.DispositionType ||
                     DispositionType != null &&
                     DispositionType.Equals(other.DispositionType)
                 ) &&
                 (
                     DispositionInstructions == other.DispositionInstructions ||
                     DispositionInstructions != null &&
                     DispositionInstructions.SequenceEqual(other.DispositionInstructions)
                 ) &&
                 (
                     Labels == other.Labels ||
                     Labels != null &&
                     Labels.SequenceEqual(other.Labels)
                 ));
        }