示例#1
0
        /// <summary>
        /// Gets the hash code for this object.
        /// </summary>
        /// <returns>
        /// The hash code for this object.
        /// </returns>
        /// <remarks>
        /// * CA2218:
        ///   * If two objects are equal in value based on the Equals override, they must both return the same value for calls
        ///     to GetHashCode.
        ///   * GetHashCode must be overridden whenever Equals is overridden.
        /// * It is fine if the value overflows.
        /// </remarks>
        public override int GetHashCode()
        {
            int result = Id.GetHashCode() +
                         GlobalId.GetHashCode() +
                         AnalyticsEventId.GetHashCode();

            if (PartnerUserInfoList != null)
            {
                foreach (PartnerUserInfo partnerUserInfo in PartnerUserInfoList)
                {
                    result += partnerUserInfo.GetHashCode();
                }
            }

            return(result);
        }
示例#2
0
        /// <summary>
        /// Gets the hash code for this object.
        /// </summary>
        /// <returns>
        /// The hash code for this object.
        /// </returns>
        /// <remarks>
        /// * CA2218:
        ///   * If two objects are equal in value based on the Equals override, they must both return the same value for calls
        ///     to GetHashCode.
        ///   * GetHashCode must be overridden whenever Equals is overridden.
        /// * It is fine if the value overflows.
        /// </remarks>
        public override int GetHashCode()
        {
            int result = GlobalId.GetHashCode() +
                         ParentDealId.GetHashCode() +
                         ProviderId.GetHashCode() +
                         MerchantId.GetHashCode() +
                         ProviderCategory.GetHashCode() +
                         StartDate.GetHashCode() +
                         EndDate.GetHashCode() +
                         Amount.GetHashCode() +
                         Count.GetHashCode() +
                         UserLimit.GetHashCode() +
                         MinimumPurchase.GetHashCode() +
                         MaximumDiscount.GetHashCode() +
                         DealStatusId.GetHashCode();

            if (MerchantName != null)
            {
                result += MerchantName.GetHashCode();
            }

            if (Currency != null)
            {
                result += Currency.GetHashCode();
            }

            if (DiscountSummary != null)
            {
                result += DiscountSummary.GetHashCode();
            }

            foreach (PartnerDealInfo partnerDealInfo in PartnerDealInfoList)
            {
                result += partnerDealInfo.GetHashCode();
            }

            if (DayTimeRestrictions != null)
            {
                result += DayTimeRestrictions.GetHashCode();
            }

            return(result);
        }
示例#3
0
文件: Cell.cs 项目: rol2728/Dev.D3
 public override int GetHashCode()
 {
     return(GlobalId.GetHashCode());
 }