示例#1
0
        // Equality and comparers

        /// <summary>
        /// Returns the hashcode for this <see cref="BatchQueryRequest"/>.
        /// </summary>
        /// <returns>The hashcode value.</returns>
        public override int GetHashCode()
        {
            // Make sure to return if it is already provided
            if (!ReferenceEquals(null, m_hashCode))
            {
                return(m_hashCode.Value);
            }

            // Get first the entity hash code
            var hashCode = string.Concat(Name, ".BatchQuery").GetHashCode();

            // Add the fields
            if (Fields != null)
            {
                foreach (var field in Fields)
                {
                    hashCode += field.GetHashCode();
                }
            }

            // Add the expression
            if (!ReferenceEquals(null, Where))
            {
                hashCode += Where.GetHashCode();
            }

            // Add the filter
            if (!ReferenceEquals(null, Page))
            {
                hashCode += Page.GetHashCode();
            }

            // Add the filter
            if (!ReferenceEquals(null, RowsPerBatch))
            {
                hashCode += RowsPerBatch.GetHashCode();
            }

            // Add the order fields
            if (!ReferenceEquals(null, OrderBy))
            {
                foreach (var orderField in OrderBy)
                {
                    hashCode += orderField.GetHashCode();
                }
            }

            // Add the hints
            if (!ReferenceEquals(null, Hints))
            {
                hashCode += Hints.GetHashCode();
            }

            // Set back the hash code value
            m_hashCode = hashCode;

            // Return the actual value
            return(hashCode);
        }
示例#2
0
        // Equality and comparers

        /// <summary>
        /// Returns the hashcode for this <see cref="BatchQueryRequest"/>.
        /// </summary>
        /// <returns>The hashcode value.</returns>
        public override int GetHashCode()
        {
            // Make sure to return if it is already provided
            if (!ReferenceEquals(null, m_hashCode))
            {
                return(m_hashCode.Value);
            }

            // Get first the entity hash code
            var hashCode = string.Concat(EntityType.FullName, ".BatchQuery").GetHashCode();

            // Add the expression
            if (!ReferenceEquals(null, Where))
            {
                hashCode += Where.GetHashCode();
            }

            // Add the filter
            if (!ReferenceEquals(null, Page))
            {
                hashCode += Page.GetHashCode();
            }

            // Add the filter
            if (!ReferenceEquals(null, RowsPerBatch))
            {
                hashCode += RowsPerBatch.GetHashCode();
            }

            // Add the order fields
            if (!ReferenceEquals(null, OrderBy))
            {
                OrderBy.ToList().ForEach(order =>
                {
                    hashCode += order.GetHashCode();
                });
            }

            // Set back the hash code value
            m_hashCode = hashCode;

            // Return the actual value
            return(hashCode);
        }