/// <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 (Preferred != null)
         {
             hashCode = hashCode * 59 + Preferred.GetHashCode();
         }
         if (ContactMediumType != null)
         {
             hashCode = hashCode * 59 + ContactMediumType.GetHashCode();
         }
         if (ValidFor != null)
         {
             hashCode = hashCode * 59 + ValidFor.GetHashCode();
         }
         if (Characteristic != null)
         {
             hashCode = hashCode * 59 + Characteristic.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if ContactMedium instances are equal
        /// </summary>
        /// <param name="other">Instance of ContactMedium to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ContactMedium other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Preferred == other.Preferred ||
                     Preferred != null &&
                     Preferred.Equals(other.Preferred)
                     ) &&
                 (
                     ContactMediumType == other.ContactMediumType ||
                     ContactMediumType != null &&
                     ContactMediumType.Equals(other.ContactMediumType)
                 ) &&
                 (
                     ValidFor == other.ValidFor ||
                     ValidFor != null &&
                     ValidFor.Equals(other.ValidFor)
                 ) &&
                 (
                     Characteristic == other.Characteristic ||
                     Characteristic != null &&
                     Characteristic.Equals(other.Characteristic)
                 ));
        }
        /// <summary>
        /// Returns true if the filter can be apply to the given type and Server type
        /// </summary>
        /// <param name="type">Type of the querier</param>
        /// <param name="validForFlag">Server Type</param>
        /// <returns></returns>
        public bool CanApplyFilter(Type type, ValidForFlag validForFlag)
        {
            bool canApplyFilter = false;

            canApplyFilter = TypeToReverse == null || TypeToReverse == type;
            canApplyFilter = canApplyFilter && (ValidFor == 0 || ValidFor.HasFlag(validForFlag));

            return(canApplyFilter);
        }
 /// <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 (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);
     }
 }
 /// <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 (CreditProfileDate != null)
         {
             hashCode = hashCode * 59 + CreditProfileDate.GetHashCode();
         }
         if (CreditRiskRating != null)
         {
             hashCode = hashCode * 59 + CreditRiskRating.GetHashCode();
         }
         if (CreditScore != null)
         {
             hashCode = hashCode * 59 + CreditScore.GetHashCode();
         }
         if (ValidFor != null)
         {
             hashCode = hashCode * 59 + ValidFor.GetHashCode();
         }
         if (TagCreditScoring != null)
         {
             hashCode = hashCode * 59 + TagCreditScoring.GetHashCode();
         }
         if (TagCreditLimit != null)
         {
             hashCode = hashCode * 59 + TagCreditLimit.GetHashCode();
         }
         if (TagCreditThreshold != null)
         {
             hashCode = hashCode * 59 + TagCreditThreshold.GetHashCode();
         }
         if (TagCreditOnHold != null)
         {
             hashCode = hashCode * 59 + TagCreditOnHold.GetHashCode();
         }
         if (TagContractDailyCreditLimit != null)
         {
             hashCode = hashCode * 59 + TagContractDailyCreditLimit.GetHashCode();
         }
         if (TagContractPeriodicCreditLimit != null)
         {
             hashCode = hashCode * 59 + TagContractPeriodicCreditLimit.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if CustomerUpdate instances are equal
        /// </summary>
        /// <param name="other">Instance of CustomerUpdate to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CustomerUpdate 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)
                 ) &&
                 (
                     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)
                 ));
        }
        /// <summary>
        /// Returns true if CreditProfile instances are equal
        /// </summary>
        /// <param name="other">Instance of CreditProfile to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CreditProfile other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CreditProfileDate == other.CreditProfileDate ||
                     CreditProfileDate != null &&
                     CreditProfileDate.Equals(other.CreditProfileDate)
                     ) &&
                 (
                     CreditRiskRating == other.CreditRiskRating ||
                     CreditRiskRating != null &&
                     CreditRiskRating.Equals(other.CreditRiskRating)
                 ) &&
                 (
                     CreditScore == other.CreditScore ||
                     CreditScore != null &&
                     CreditScore.Equals(other.CreditScore)
                 ) &&
                 (
                     ValidFor == other.ValidFor ||
                     ValidFor != null &&
                     ValidFor.Equals(other.ValidFor)
                 ) &&
                 (
                     TagCreditScoring == other.TagCreditScoring ||
                     TagCreditScoring != null &&
                     TagCreditScoring.Equals(other.TagCreditScoring)
                 ) &&
                 (
                     TagCreditLimit == other.TagCreditLimit ||
                     TagCreditLimit != null &&
                     TagCreditLimit.Equals(other.TagCreditLimit)
                 ) &&
                 (
                     TagCreditThreshold == other.TagCreditThreshold ||
                     TagCreditThreshold != null &&
                     TagCreditThreshold.Equals(other.TagCreditThreshold)
                 ) &&
                 (
                     TagCreditOnHold == other.TagCreditOnHold ||
                     TagCreditOnHold != null &&
                     TagCreditOnHold.Equals(other.TagCreditOnHold)
                 ) &&
                 (
                     TagContractDailyCreditLimit == other.TagContractDailyCreditLimit ||
                     TagContractDailyCreditLimit != null &&
                     TagContractDailyCreditLimit.Equals(other.TagContractDailyCreditLimit)
                 ) &&
                 (
                     TagContractPeriodicCreditLimit == other.TagContractPeriodicCreditLimit ||
                     TagContractPeriodicCreditLimit != null &&
                     TagContractPeriodicCreditLimit.Equals(other.TagContractPeriodicCreditLimit)
                 ));
        }
Exemple #8
0
        /// <summary>
        /// Returns true if Customer instances are equal
        /// </summary>
        /// <param name="other">Instance of Customer to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Customer other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Href == other.Href ||
                     Href != null &&
                     Href.Equals(other.Href)
                     ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     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)
                 ) &&
                 (
                     PreferredLanguage == other.PreferredLanguage ||
                     PreferredLanguage != null &&
                     PreferredLanguage.Equals(other.PreferredLanguage)
                 ) &&
                 (
                     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)
                 ));
        }