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