当前位置: 首页>>代码示例>>C#>>正文


C# MergeOption.GetHashCode方法代码示例

本文整理汇总了C#中MergeOption.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# MergeOption.GetHashCode方法的具体用法?C# MergeOption.GetHashCode怎么用?C# MergeOption.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MergeOption的用法示例。


在下文中一共展示了MergeOption.GetHashCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EntitySqlQueryCacheKey

        /// <summary>
        /// Creates a new instance of ObjectQueryCacheKey given a entityCommand instance
        /// </summary>
        /// <param name="defaultContainerName">The default container name in effect when parsing the query (may be null)</param>
        /// <param name="eSqlStatement">The Entity-SQL text of the query</param>
        /// <param name="parameterCount">The number of parameters to the query</param>
        /// <param name="parametersToken">A string representation of the parameters to the query (may be null)</param>
        /// <param name="includePathsToken">A string representation of the Include span paths in effect (may be null)</param>
        /// <param name="mergeOption">The merge option in effect. Required for result assembly.</param>
        internal EntitySqlQueryCacheKey(
            string defaultContainerName,
            string eSqlStatement,
            int parameterCount,
            string parametersToken,
            string includePathsToken,
            MergeOption mergeOption,
            Type resultType)
        {
            Debug.Assert(null != eSqlStatement, "eSqlStatement must not be null");

            _defaultContainer = defaultContainerName;
            _eSqlStatement = eSqlStatement;
            _parameterCount = parameterCount;
            _parametersToken = parametersToken;
            _includePathsToken = includePathsToken;
            _mergeOption = mergeOption;
            _resultType = resultType;

            var combinedHash = _eSqlStatement.GetHashCode() ^
                               _mergeOption.GetHashCode();

            if (_parametersToken != null)
            {
                combinedHash ^= _parametersToken.GetHashCode();
            }

            if (_includePathsToken != null)
            {
                combinedHash ^= _includePathsToken.GetHashCode();
            }

            if (_defaultContainer != null)
            {
                combinedHash ^= _defaultContainer.GetHashCode();
            }

            _hashCode = combinedHash;
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:48,代码来源:EntitySqlQueryCacheKey.cs

示例2: LinqQueryCacheKey

        /// <summary>
        /// Creates a new instance of LinqQueryCacheKey.
        /// </summary>
        /// <param name="expressionKey">The DbExpression key of the linq query</param>
        /// <param name="parameterCount">The number of parameters to the query</param>
        /// <param name="parametersToken">A string representation of the parameters to the query (may be null)</param>
        /// <param name="includePathsToken">A string representation of the Include span paths in effect (may be null)</param>
        /// <param name="mergeOption">The merge option in effect. Required for result assembly.</param>
        /// <param name="useCSharpNullComparisonBehavior">Flag indicating if the C# behavior should be used for null comparisons</param>
        /// <param name="resultType">The type of each result item - for a given query as a CLR type instance</param>
        internal LinqQueryCacheKey(
            string expressionKey,
            int parameterCount,
            string parametersToken,
            string includePathsToken,
            MergeOption mergeOption,
            bool useCSharpNullComparisonBehavior,
            Type resultType)
        {
            Debug.Assert(null != expressionKey, "expressionKey must not be null");

            _expressionKey = expressionKey;
            _parameterCount = parameterCount;
            _parametersToken = parametersToken;
            _includePathsToken = includePathsToken;
            _mergeOption = mergeOption;
            _resultType = resultType;
            _useCSharpNullComparisonBehavior = useCSharpNullComparisonBehavior;

            var combinedHash = _expressionKey.GetHashCode() ^
                               _mergeOption.GetHashCode();

            if (_parametersToken != null)
            {
                combinedHash ^= _parametersToken.GetHashCode();
            }

            if (_includePathsToken != null)
            {
                combinedHash ^= _includePathsToken.GetHashCode();
            }

            combinedHash ^= _useCSharpNullComparisonBehavior.GetHashCode();

            _hashCode = combinedHash;
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:46,代码来源:LinqQueryCacheKey.cs

示例3: EntitySqlQueryCacheKey

        // <summary>
        // Creates a new instance of ObjectQueryCacheKey given a entityCommand instance
        // </summary>
        // <param name="defaultContainerName"> The default container name in effect when parsing the query (may be null) </param>
        // <param name="eSqlStatement"> The Entity-SQL text of the query </param>
        // <param name="parameterCount"> The number of parameters to the query </param>
        // <param name="parametersToken"> A string representation of the parameters to the query (may be null) </param>
        // <param name="includePathsToken"> A string representation of the Include span paths in effect (may be null) </param>
        // <param name="mergeOption"> The merge option in effect. Required for result assembly. </param>
        internal EntitySqlQueryCacheKey(
            string defaultContainerName,
            string eSqlStatement,
            int parameterCount,
            string parametersToken,
            string includePathsToken,
            MergeOption mergeOption,
            bool streaming,
            Type resultType)
        {
            DebugCheck.NotNull(eSqlStatement);

            _defaultContainer = defaultContainerName;
            _eSqlStatement = eSqlStatement;
            _parameterCount = parameterCount;
            _parametersToken = parametersToken;
            _includePathsToken = includePathsToken;
            _mergeOption = mergeOption;
            _streaming = streaming;
            _resultType = resultType;

            var combinedHash = _eSqlStatement.GetHashCode() ^
                               _mergeOption.GetHashCode();

            if (_parametersToken != null)
            {
                combinedHash ^= _parametersToken.GetHashCode();
            }

            if (_includePathsToken != null)
            {
                combinedHash ^= _includePathsToken.GetHashCode();
            }

            if (_defaultContainer != null)
            {
                combinedHash ^= _defaultContainer.GetHashCode();
            }

            _hashCode = combinedHash;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:50,代码来源:EntitySqlQueryCacheKey.cs


注:本文中的MergeOption.GetHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。