Table of Contents

Class ShapedQueryCompilingExpressionVisitor

Namespace
Microsoft.EntityFrameworkCore.Query
Assembly
Microsoft.EntityFrameworkCore.dll

A class that compiles the shaper expression for given shaped query expression.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public abstract class ShapedQueryCompilingExpressionVisitor : ExpressionVisitor
Inheritance
ShapedQueryCompilingExpressionVisitor
Inherited Members

Remarks

Materializer is a code which creates entity instance from the given property values. It takes into account constructor bindings, fields, property access mode configured in the model when creating the instance.

Shaper is a code which generate result for the query from given scalar values based on the structure of projection. A shaper can contain zero or more materializers inside it.

See Implementation of database providers and extensions and How EF Core queries work for more information and examples.

Constructors

ShapedQueryCompilingExpressionVisitor(ShapedQueryCompilingExpressionVisitorDependencies, QueryCompilationContext)

Creates a new instance of the ShapedQueryCompilingExpressionVisitor class.

protected ShapedQueryCompilingExpressionVisitor(ShapedQueryCompilingExpressionVisitorDependencies dependencies, QueryCompilationContext queryCompilationContext)

Parameters

dependencies ShapedQueryCompilingExpressionVisitorDependencies

Parameter object containing dependencies for this class.

queryCompilationContext QueryCompilationContext

The query compilation context object to use.

Properties

Dependencies

Dependencies for this service.

protected virtual ShapedQueryCompilingExpressionVisitorDependencies Dependencies { get; }

Property Value

ShapedQueryCompilingExpressionVisitorDependencies

QueryCompilationContext

The query compilation context object for current compilation.

protected virtual QueryCompilationContext QueryCompilationContext { get; }

Property Value

QueryCompilationContext

Methods

InjectEntityMaterializers(Expression)

Inject entity materializers in given shaper expression. StructuralTypeShaperExpression is replaced with materializer expression for given entity.

protected virtual Expression InjectEntityMaterializers(Expression expression)

Parameters

expression Expression

The expression to inject entity materializers.

Returns

Expression

A expression with entity materializers injected.

VerifyNoClientConstant(Expression)

Verifies that the given shaper expression does not contain client side constant which could cause memory leak.

protected virtual void VerifyNoClientConstant(Expression expression)

Parameters

expression Expression

An expression to verify.

VisitExtension(Expression)

protected override Expression VisitExtension(Expression extensionExpression)

Parameters

extensionExpression Expression

Returns

Expression

VisitShapedQuery(ShapedQueryExpression)

Visits given shaped query expression to create an expression of enumerable.

protected abstract Expression VisitShapedQuery(ShapedQueryExpression shapedQueryExpression)

Parameters

shapedQueryExpression ShapedQueryExpression

The shaped query expression to compile.

Returns

Expression

An expression of enumerable.