Beispiel #1
0
        /// <summary>
        /// Returns the hashcode for this <see cref="SqlServerDbSetting"/>.
        /// </summary>
        /// <returns>The hashcode value.</returns>
        public override int GetHashCode()
        {
            if (!ReferenceEquals(null, m_hashCode))
            {
                return(m_hashCode.Value);
            }

            // Use the non nullable for perf purposes
            var hashCode = 0;

            // OpeningQuote
            if (!string.IsNullOrEmpty(OpeningQuote))
            {
                hashCode += OpeningQuote.GetHashCode();
            }

            // ClosingQuote
            if (!string.IsNullOrEmpty(ClosingQuote))
            {
                hashCode += ClosingQuote.GetHashCode();
            }

            // ParameterPrefix
            if (!string.IsNullOrEmpty(ParameterPrefix))
            {
                hashCode += ParameterPrefix.GetHashCode();
            }

            // SchemaSeparator
            if (!string.IsNullOrEmpty(SchemaSeparator))
            {
                hashCode += SchemaSeparator.GetHashCode();
            }

            // DefaultSchema
            if (!string.IsNullOrEmpty(DefaultSchema))
            {
                hashCode += DefaultSchema.GetHashCode();
            }

            // Set back the value
            m_hashCode = hashCode;

            // Return the value
            return(hashCode);
        }
Beispiel #2
0
        /// <summary>
        /// Returns the hashcode for this <see cref="SqlServerDbSetting"/>.
        /// </summary>
        /// <returns>The hashcode value.</returns>
        public override int GetHashCode()
        {
            if (m_hashCode != null)
            {
                return(m_hashCode.Value);
            }

            // Use the non nullable for perf purposes
            var hashCode = 0;

            // IsMultipleStatementExecutionSupported
            hashCode += IsMultipleStatementExecutionSupported.GetHashCode();

            // IsDbParameterDirectionSettingSupported
            hashCode += IsDbParameterDirectionSettingSupported.GetHashCode();

            // IsUseUpsertForMergeOperation
            hashCode += IsUseUpsertForMergeOperation.GetHashCode();

            // AreTableHintsSupported
            hashCode += AreTableHintsSupported.GetHashCode();

            // OpeningQuote
            if (!string.IsNullOrEmpty(OpeningQuote))
            {
                hashCode += OpeningQuote.GetHashCode();
            }

            // ClosingQuote
            if (!string.IsNullOrEmpty(ClosingQuote))
            {
                hashCode += ClosingQuote.GetHashCode();
            }

            // ParameterPrefix
            if (!string.IsNullOrEmpty(ParameterPrefix))
            {
                hashCode += ParameterPrefix.GetHashCode();
            }

            // SchemaSeparator
            if (!string.IsNullOrEmpty(SchemaSeparator))
            {
                hashCode += SchemaSeparator.GetHashCode();
            }

            // DefaultSchema
            if (!string.IsNullOrEmpty(DefaultSchema))
            {
                hashCode += DefaultSchema.GetHashCode();
            }

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

            // Set and return the hashcode
            return((m_hashCode = hashCode).Value);
        }