本文整理汇总了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;
}
示例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;
}
示例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;
}