Table of Contents

Class ShapedQueryExpression

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

An expression that combines a query expression and shaper expression.

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

public class ShapedQueryExpression : Expression, IPrintableExpression
Inheritance
ShapedQueryExpression
Implements
Inherited Members
Extension Methods

Remarks

Constructors

ShapedQueryExpression(Expression, Expression)

Creates a new instance of the ShapedQueryExpression class with associated query and shaper expressions.

public ShapedQueryExpression(Expression queryExpression, Expression shaperExpression)

Parameters

queryExpression Expression

The query expression to get results from server.

shaperExpression Expression

The shaper expression to create result objects from server results.

Properties

NodeType

public override sealed ExpressionType NodeType { get; }

Property Value

ExpressionType

QueryExpression

An expression representing the query to be run against server to retrieve the data.

public virtual Expression QueryExpression { get; }

Property Value

Expression

ResultCardinality

The cardinality of the results generated.

public virtual ResultCardinality ResultCardinality { get; }

Property Value

ResultCardinality

ShaperExpression

An expression representing the shaper to be run on the results fetched from the server.

public virtual Expression ShaperExpression { get; }

Property Value

Expression

Type

public override Type Type { get; }

Property Value

Type

Methods

Update(Expression, Expression)

Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.

public virtual ShapedQueryExpression Update(Expression queryExpression, Expression shaperExpression)

Parameters

queryExpression Expression

The QueryExpression property of the result.

shaperExpression Expression

The ShaperExpression property of the result.

Returns

ShapedQueryExpression

This expression if no children changed, or an expression with the updated children.

UpdateQueryExpression(Expression)

Creates a new expression that is like this one, but using the supplied query expression. If query expression is the same, it will return this expression.

public virtual ShapedQueryExpression UpdateQueryExpression(Expression queryExpression)

Parameters

queryExpression Expression

The QueryExpression property of the result.

Returns

ShapedQueryExpression

This expression if shaper expression did not change, or an expression with the updated shaper expression.

UpdateResultCardinality(ResultCardinality)

Creates a new expression that is like this one, but with supplied result cardinality.

public virtual ShapedQueryExpression UpdateResultCardinality(ResultCardinality resultCardinality)

Parameters

resultCardinality ResultCardinality

The ResultCardinality property of the result.

Returns

ShapedQueryExpression

An expression with the updated result cardinality.

UpdateShaperExpression(Expression)

Creates a new expression that is like this one, but using the supplied shaper expression. If shaper expression is the same, it will return this expression.

public virtual ShapedQueryExpression UpdateShaperExpression(Expression shaperExpression)

Parameters

shaperExpression Expression

The ShaperExpression property of the result.

Returns

ShapedQueryExpression

This expression if shaper expression did not change, or an expression with the updated shaper expression.

VisitChildren(ExpressionVisitor)

protected override Expression VisitChildren(ExpressionVisitor visitor)

Parameters

visitor ExpressionVisitor

Returns

Expression