Class ExpressionKey
Equality wrapper around an Expression that uses the query registry's
ExpressionPlanEqualityComparer, so two expressions that describe the same query plan hash and
compare equal even when they are different object instances. The hash is computed once at
construction because both inputs are immutable.
public sealed class ExpressionKey : IEquatable<ExpressionKey>
- Inheritance
-
ExpressionKey
- Implements
- Inherited Members
- Extension Methods
Constructors
ExpressionKey(Expression, IQueryRegistry)
Initializes a new key for exp using the plan equality comparer obtained from
queryProvider, and precomputes its hash.
public ExpressionKey(Expression exp, IQueryRegistry queryProvider)
Parameters
expExpressionThe expression to use as the cache key.
queryProviderIQueryRegistryRegistry that supplies the plan equality comparer for the expression.
Methods
Equals(ExpressionKey?)
Determines whether obj describes the same query plan as this key, using the
registry's plan equality comparer.
public bool Equals(ExpressionKey? obj)
Parameters
objExpressionKeyThe other key to compare with, or null.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.