Share via


EntityShaperExpression Class

Definition

An expression that represents creation of an entity instance in ShaperExpression.

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

public class EntityShaperExpression : System.Linq.Expressions.Expression, Microsoft.EntityFrameworkCore.Query.IPrintableExpression
type EntityShaperExpression = class
    inherit Expression
    interface IPrintableExpression
Public Class EntityShaperExpression
Inherits Expression
Implements IPrintableExpression
Inheritance
EntityShaperExpression
Derived
Implements

Remarks

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

Constructors

EntityShaperExpression(IEntityType, Expression, Boolean, LambdaExpression)

Creates a new instance of the EntityShaperExpression class.

EntityShaperExpression(IEntityType, Expression, Boolean)

Creates a new instance of the EntityShaperExpression class.

Properties

EntityType

The entity type being shaped.

IsNullable

A value indicating whether this entity instance can be null.

MaterializationCondition

The materilization condition to use for shaping this entity.

NodeType

Gets the node type of this Expression.

Type

Gets the static type of the expression that this Expression represents.

ValueBufferExpression

The expression representing a ValueBuffer to get values from that are used to create the entity instance.

Methods

CreateUnableToDiscriminateExceptionExpression(IEntityType, Expression)

Creates an expression to throw an exception when unable to determine entity type to materialize based on discriminator value.

GenerateMaterializationCondition(IEntityType, Boolean)

Creates an expression of Func<T,TResult> to determine which entity type to materialize.

MakeNullable(Boolean)

Assigns nullability for this shaper, indicating whether it can shape null entity instances or not.

MarkAsNullable()
Obsolete.

Marks this shaper as nullable, indicating that it can shape null entity instances.

Print(ExpressionPrinter)
Update(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.

VisitChildren(ExpressionVisitor)

Reduces the node and then calls the visitor delegate on the reduced expression. The method throws an exception if the node is not reducible.

WithEntityType(IEntityType)

Changes the entity type being shaped by this entity shaper.

Explicit Interface Implementations

IPrintableExpression.Print(ExpressionPrinter)

Creates a printable string representation of the given expression using ExpressionPrinter.

Applies to