示例#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);
        }
示例#2
0
        /// <summary>
        /// Returns the hashcode for this <see cref="BaseDbSetting"/>.
        /// </summary>
        /// <returns>The hashcode value.</returns>
        public override int GetHashCode()
        {
            if (this.hashCode != null)
            {
                return(this.hashCode.Value);
            }

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

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

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

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

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

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

            // IsDisposeDbCommandAfterExecuteReader
            hashCode += IsExecuteReaderDisposable.GetHashCode();

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

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

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

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

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

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