public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is CatalogPricingRule other &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((TimePeriodIds == null && other.TimePeriodIds == null) || (TimePeriodIds?.Equals(other.TimePeriodIds) == true)) &&
                   ((DiscountId == null && other.DiscountId == null) || (DiscountId?.Equals(other.DiscountId) == true)) &&
                   ((MatchProductsId == null && other.MatchProductsId == null) || (MatchProductsId?.Equals(other.MatchProductsId) == true)) &&
                   ((ApplyProductsId == null && other.ApplyProductsId == null) || (ApplyProductsId?.Equals(other.ApplyProductsId) == true)) &&
                   ((ExcludeProductsId == null && other.ExcludeProductsId == null) || (ExcludeProductsId?.Equals(other.ExcludeProductsId) == true)) &&
                   ((ValidFromDate == null && other.ValidFromDate == null) || (ValidFromDate?.Equals(other.ValidFromDate) == true)) &&
                   ((ValidFromLocalTime == null && other.ValidFromLocalTime == null) || (ValidFromLocalTime?.Equals(other.ValidFromLocalTime) == true)) &&
                   ((ValidUntilDate == null && other.ValidUntilDate == null) || (ValidUntilDate?.Equals(other.ValidUntilDate) == true)) &&
                   ((ValidUntilLocalTime == null && other.ValidUntilLocalTime == null) || (ValidUntilLocalTime?.Equals(other.ValidUntilLocalTime) == true)) &&
                   ((ExcludeStrategy == null && other.ExcludeStrategy == null) || (ExcludeStrategy?.Equals(other.ExcludeStrategy) == true)));
        }
Esempio n. 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (DiscountId != 0)
            {
                hash ^= DiscountId.GetHashCode();
            }
            if (Code.Length != 0)
            {
                hash ^= Code.GetHashCode();
            }
            if (Amount != 0)
            {
                hash ^= Amount.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Address1 != null ? Address1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Address2 != null ? Address2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CartNote != null ? CartNote.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (City != null ? City.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Company != null ? Company.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Country != null ? Country.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CreatedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ CustomerId.GetHashCode();
         hashCode = (hashCode * 397) ^ DiscountId.GetHashCode();
         hashCode = (hashCode * 397) ^ (FirstName != null ? FirstName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Id.GetHashCode();
         hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Phone != null ? Phone.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Province != null ? Province.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ UpdatedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ (Zip != null ? Zip.GetHashCode() : 0);
         return(hashCode);
     }
 }
        public override int GetHashCode()
        {
            int hashCode = -988778351;

            if (Name != null)
            {
                hashCode += Name.GetHashCode();
            }

            if (TimePeriodIds != null)
            {
                hashCode += TimePeriodIds.GetHashCode();
            }

            if (DiscountId != null)
            {
                hashCode += DiscountId.GetHashCode();
            }

            if (MatchProductsId != null)
            {
                hashCode += MatchProductsId.GetHashCode();
            }

            if (ApplyProductsId != null)
            {
                hashCode += ApplyProductsId.GetHashCode();
            }

            if (ExcludeProductsId != null)
            {
                hashCode += ExcludeProductsId.GetHashCode();
            }

            if (ValidFromDate != null)
            {
                hashCode += ValidFromDate.GetHashCode();
            }

            if (ValidFromLocalTime != null)
            {
                hashCode += ValidFromLocalTime.GetHashCode();
            }

            if (ValidUntilDate != null)
            {
                hashCode += ValidUntilDate.GetHashCode();
            }

            if (ValidUntilLocalTime != null)
            {
                hashCode += ValidUntilLocalTime.GetHashCode();
            }

            if (ExcludeStrategy != null)
            {
                hashCode += ExcludeStrategy.GetHashCode();
            }

            return(hashCode);
        }