Table of Contents

Class ExpressionKey

Namespace
NextORM.Core
Assembly
nextorm.core.dll

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

exp Expression

The expression to use as the cache key.

queryProvider IQueryRegistry

Registry 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

obj ExpressionKey

The other key to compare with, or null.

Returns

bool

true when both keys hold plan-equivalent expressions.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.