/// <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 (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (Identification != null) { hashCode = hashCode * 59 + Identification.GetHashCode(); } if (RewardsProgram != null) { hashCode = hashCode * 59 + RewardsProgram.GetHashCode(); } if (Fees != null) { hashCode = hashCode * 59 + Fees.GetHashCode(); } if (Interest != null) { hashCode = hashCode * 59 + Interest.GetHashCode(); } if (TermsConditions != null) { hashCode = hashCode * 59 + TermsConditions.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if CreditCard instances are equal /// </summary> /// <param name="other">Instance of CreditCard to be compared</param> /// <returns>Boolean</returns> public bool Equals(CreditCard other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( Identification == other.Identification || Identification != null && Identification.Equals(other.Identification) ) && ( RewardsProgram == other.RewardsProgram || RewardsProgram != null && RewardsProgram.Equals(other.RewardsProgram) ) && ( Fees == other.Fees || Fees != null && Fees.Equals(other.Fees) ) && ( Interest == other.Interest || Interest != null && Interest.Equals(other.Interest) ) && ( TermsConditions == other.TermsConditions || TermsConditions != null && TermsConditions.Equals(other.TermsConditions) )); }