コード例 #1
0
        public override int GetHashCode()
        {
            int hashCode = 737510073;

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

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

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

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

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

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

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

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

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

            return(hashCode);
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

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

            return(obj is SearchCatalogItemsRequest other &&
                   ((TextFilter == null && other.TextFilter == null) || (TextFilter?.Equals(other.TextFilter) == true)) &&
                   ((CategoryIds == null && other.CategoryIds == null) || (CategoryIds?.Equals(other.CategoryIds) == true)) &&
                   ((StockLevels == null && other.StockLevels == null) || (StockLevels?.Equals(other.StockLevels) == true)) &&
                   ((EnabledLocationIds == null && other.EnabledLocationIds == null) || (EnabledLocationIds?.Equals(other.EnabledLocationIds) == true)) &&
                   ((Cursor == null && other.Cursor == null) || (Cursor?.Equals(other.Cursor) == true)) &&
                   ((Limit == null && other.Limit == null) || (Limit?.Equals(other.Limit) == true)) &&
                   ((SortOrder == null && other.SortOrder == null) || (SortOrder?.Equals(other.SortOrder) == true)) &&
                   ((ProductTypes == null && other.ProductTypes == null) || (ProductTypes?.Equals(other.ProductTypes) == true)) &&
                   ((CustomAttributeFilters == null && other.CustomAttributeFilters == null) || (CustomAttributeFilters?.Equals(other.CustomAttributeFilters) == true)));
        }