Interface IQueryComponentShape
Optional pre-preparation structural identity of a query component, used by the engine's raw (pre-preparation) recipe cache. The engine captures a command's value-free raw shape before it is prepared and may then reuse another command's prepared plan, so a component that wants that fast path must describe, without a prepare context, which of its state changes the statement it produces. Two components that report an equal ShapeState and structurally equal selectors must render the same statement for the same command; that is the contract this interface carries.
public interface IQueryComponentShape
- Extension Methods
Remarks
A component that does not implement this interface stays eligible for every other path but is excluded from the raw recipe cache: its state is invisible before preparation, and reusing a plan prepared for a different component would silently change the SQL it renders.
Properties
ShapeSelectorCount
The number of selector expressions that participate in the structural identity.
int ShapeSelectorCount { get; }
Property Value
ShapeSelectors
The selector expressions that participate in the structural identity, as a cached array. Implementations should cache this once per component instance to avoid per-capture allocation.
LambdaExpression[] ShapeSelectors { get; }
Property Value
ShapeState
The scalar part of the structural identity — direction, tie policy, flags. Compared with Equals(object), so the value must implement a stable equality and hash code.
object? ShapeState { get; }
Property Value
Methods
GetShapeSelector(int)
Returns the selector expression at index; compared with the engine expression comparer.
LambdaExpression GetShapeSelector(int index)
Parameters
indexintZero-based selector index, below ShapeSelectorCount.
Returns
- LambdaExpression
The selector expression.