Table of Contents

Class ExpressionPlanEqualityComparer

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Compares expressions structurally so that logically identical queries share a cached plan. Owns the thread-static hashing visitor used by GetHashCode.

public class ExpressionPlanEqualityComparer : IEqualityComparer<Expression?>
Inheritance
ExpressionPlanEqualityComparer
Implements
Inherited Members
Extension Methods

Constructors

ExpressionPlanEqualityComparer(IQueryRegistry)

Creates a comparer for the given registry without plan-cache logging.

public ExpressionPlanEqualityComparer(IQueryRegistry queryProvider)

Parameters

queryProvider IQueryRegistry

The registry that resolves referenced queries and nested comparers.

ExpressionPlanEqualityComparer(IQueryRegistry, ILogger?)

Creates a comparer for the given registry, logging plan-cache misses through logger.

public ExpressionPlanEqualityComparer(IQueryRegistry queryProvider, ILogger? logger)

Parameters

queryProvider IQueryRegistry

The registry that resolves referenced queries and nested comparers.

logger ILogger

The optional logger for plan-cache diagnostics.

Methods

Equals(Expression?, Expression?)

Determines whether the specified objects are equal.

public bool Equals(Expression? left, Expression? right)

Parameters

left Expression
right Expression

Returns

bool

true if the specified objects are equal; otherwise, false.

GetHashCode(Expression)

Returns a structural hash of obj, resolving nested commands and outer references through the registry.

public int GetHashCode(Expression obj)

Parameters

obj Expression

The expression to hash.

Returns

int

The structural hash, or 0 when obj is null.