Example #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 (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Status != null)
         {
             hashCode = hashCode * 59 + Status.GetHashCode();
         }
         if (StatusReason != null)
         {
             hashCode = hashCode * 59 + StatusReason.GetHashCode();
         }
         if (ValidFor != null)
         {
             hashCode = hashCode * 59 + ValidFor.GetHashCode();
         }
         if (EngagedParty != null)
         {
             hashCode = hashCode * 59 + EngagedParty.GetHashCode();
         }
         if (PartyRoleType != null)
         {
             hashCode = hashCode * 59 + PartyRoleType.GetHashCode();
         }
         if (Account != null)
         {
             hashCode = hashCode * 59 + Account.GetHashCode();
         }
         if (PaymentMethod != null)
         {
             hashCode = hashCode * 59 + PaymentMethod.GetHashCode();
         }
         if (ContactMedium != null)
         {
             hashCode = hashCode * 59 + ContactMedium.GetHashCode();
         }
         if (Characteristic != null)
         {
             hashCode = hashCode * 59 + Characteristic.GetHashCode();
         }
         if (CreditProfile != null)
         {
             hashCode = hashCode * 59 + CreditProfile.GetHashCode();
         }
         if (Agreement != null)
         {
             hashCode = hashCode * 59 + Agreement.GetHashCode();
         }
         if (RelatedParty != null)
         {
             hashCode = hashCode * 59 + RelatedParty.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #2
0
        /// <summary>
        /// Returns true if CustomerCreate instances are equal
        /// </summary>
        /// <param name="other">Instance of CustomerCreate to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CustomerCreate other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     StatusReason == other.StatusReason ||
                     StatusReason != null &&
                     StatusReason.Equals(other.StatusReason)
                 ) &&
                 (
                     ValidFor == other.ValidFor ||
                     ValidFor != null &&
                     ValidFor.Equals(other.ValidFor)
                 ) &&
                 (
                     EngagedParty == other.EngagedParty ||
                     EngagedParty != null &&
                     EngagedParty.Equals(other.EngagedParty)
                 ) &&
                 (
                     PartyRoleType == other.PartyRoleType ||
                     PartyRoleType != null &&
                     PartyRoleType.Equals(other.PartyRoleType)
                 ) &&
                 (
                     Account == other.Account ||
                     Account != null &&
                     Account.SequenceEqual(other.Account)
                 ) &&
                 (
                     PaymentMethod == other.PaymentMethod ||
                     PaymentMethod != null &&
                     PaymentMethod.SequenceEqual(other.PaymentMethod)
                 ) &&
                 (
                     ContactMedium == other.ContactMedium ||
                     ContactMedium != null &&
                     ContactMedium.SequenceEqual(other.ContactMedium)
                 ) &&
                 (
                     Characteristic == other.Characteristic ||
                     Characteristic != null &&
                     Characteristic.SequenceEqual(other.Characteristic)
                 ) &&
                 (
                     CreditProfile == other.CreditProfile ||
                     CreditProfile != null &&
                     CreditProfile.SequenceEqual(other.CreditProfile)
                 ) &&
                 (
                     Agreement == other.Agreement ||
                     Agreement != null &&
                     Agreement.SequenceEqual(other.Agreement)
                 ) &&
                 (
                     RelatedParty == other.RelatedParty ||
                     RelatedParty != null &&
                     RelatedParty.SequenceEqual(other.RelatedParty)
                 ));
        }