Пример #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 (BoletoBancarioRequiredness != null)
         {
             hashCode = hashCode * 59 + BoletoBancarioRequiredness.GetHashCode();
         }
         if (EmailAddress != null)
         {
             hashCode = hashCode * 59 + EmailAddress.GetHashCode();
         }
         if (ExpirationDate != null)
         {
             hashCode = hashCode * 59 + ExpirationDate.GetHashCode();
         }
         if (FixedList != null)
         {
             hashCode = hashCode * 59 + FixedList.GetHashCode();
         }
         if (Iban != null)
         {
             hashCode = hashCode * 59 + Iban.GetHashCode();
         }
         if (Length != null)
         {
             hashCode = hashCode * 59 + Length.GetHashCode();
         }
         if (Luhn != null)
         {
             hashCode = hashCode * 59 + Luhn.GetHashCode();
         }
         if (Range != null)
         {
             hashCode = hashCode * 59 + Range.GetHashCode();
         }
         if (RegularExpression != null)
         {
             hashCode = hashCode * 59 + RegularExpression.GetHashCode();
         }
         if (TermsAndConditions != null)
         {
             hashCode = hashCode * 59 + TermsAndConditions.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
        /// <summary>
        /// Returns true if PaymentProductFieldValidators instances are equal
        /// </summary>
        /// <param name="other">Instance of PaymentProductFieldValidators to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PaymentProductFieldValidators other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BoletoBancarioRequiredness == other.BoletoBancarioRequiredness ||
                     BoletoBancarioRequiredness != null &&
                     BoletoBancarioRequiredness.Equals(other.BoletoBancarioRequiredness)
                     ) &&
                 (
                     EmailAddress == other.EmailAddress ||
                     EmailAddress != null &&
                     EmailAddress.Equals(other.EmailAddress)
                 ) &&
                 (
                     ExpirationDate == other.ExpirationDate ||
                     ExpirationDate != null &&
                     ExpirationDate.Equals(other.ExpirationDate)
                 ) &&
                 (
                     FixedList == other.FixedList ||
                     FixedList != null &&
                     FixedList.Equals(other.FixedList)
                 ) &&
                 (
                     Iban == other.Iban ||
                     Iban != null &&
                     Iban.Equals(other.Iban)
                 ) &&
                 (
                     Length == other.Length ||
                     Length != null &&
                     Length.Equals(other.Length)
                 ) &&
                 (
                     Luhn == other.Luhn ||
                     Luhn != null &&
                     Luhn.Equals(other.Luhn)
                 ) &&
                 (
                     Range == other.Range ||
                     Range != null &&
                     Range.Equals(other.Range)
                 ) &&
                 (
                     RegularExpression == other.RegularExpression ||
                     RegularExpression != null &&
                     RegularExpression.Equals(other.RegularExpression)
                 ) &&
                 (
                     TermsAndConditions == other.TermsAndConditions ||
                     TermsAndConditions != null &&
                     TermsAndConditions.Equals(other.TermsAndConditions)
                 ));
        }