コード例 #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 (Payer != null)
         {
             hashCode = hashCode * 59 + Payer.GetHashCode();
         }
         if (Payee != null)
         {
             hashCode = hashCode * 59 + Payee.GetHashCode();
         }
         if (ExtensionUType != null)
         {
             hashCode = hashCode * 59 + ExtensionUType.GetHashCode();
         }
         if (ExtendedDescription != null)
         {
             hashCode = hashCode * 59 + ExtendedDescription.GetHashCode();
         }
         if (ServiceId != null)
         {
             hashCode = hashCode * 59 + ServiceId.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns true if BankingTransactionDetailExtendedData instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingTransactionDetailExtendedData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingTransactionDetailExtendedData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Payer == other.Payer ||
                     Payer != null &&
                     Payer.Equals(other.Payer)
                     ) &&
                 (
                     Payee == other.Payee ||
                     Payee != null &&
                     Payee.Equals(other.Payee)
                 ) &&
                 (
                     ExtensionUType == other.ExtensionUType ||
                     ExtensionUType != null &&
                     ExtensionUType.Equals(other.ExtensionUType)
                 ) &&
                 (
                     ExtendedDescription == other.ExtendedDescription ||
                     ExtendedDescription != null &&
                     ExtendedDescription.Equals(other.ExtendedDescription)
                 ) &&
                 (
                     ServiceId == other.ServiceId ||
                     ServiceId != null &&
                     ServiceId.Equals(other.ServiceId)
                 ));
        }