Table of Contents

Class EntityQueryRootExpression

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

An expression that represents an entity query root in query expression.

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

public class EntityQueryRootExpression : QueryRootExpression, IPrintableExpression
Inheritance
EntityQueryRootExpression
Implements
Inherited Members
Extension Methods

Remarks

Constructors

EntityQueryRootExpression(IEntityType)

Creates a new instance of the EntityQueryRootExpression class without any query provider.

public EntityQueryRootExpression(IEntityType entityType)

Parameters

entityType IEntityType

The entity type this query root represents.

EntityQueryRootExpression(IAsyncQueryProvider, IEntityType)

Creates a new instance of the EntityQueryRootExpression class with associated query provider.

public EntityQueryRootExpression(IAsyncQueryProvider asyncQueryProvider, IEntityType entityType)

Parameters

asyncQueryProvider IAsyncQueryProvider

The query provider associated with this query root.

entityType IEntityType

The entity type this query root represents.

Properties

CanReduce

public override bool CanReduce { get; }

Property Value

bool

EntityType

The entity type represented by this query root.

public virtual IEntityType EntityType { get; }

Property Value

IEntityType

NodeType

public override ExpressionType NodeType { get; }

Property Value

ExpressionType

Methods

DetachQueryProvider()

Detaches the associated query provider from this query root expression.

public override Expression DetachQueryProvider()

Returns

Expression

A new query root expression without query provider.

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Print(ExpressionPrinter)

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

protected override void Print(ExpressionPrinter expressionPrinter)

Parameters

expressionPrinter ExpressionPrinter

The expression printer to use.

UpdateEntityType(IEntityType)

Updates entity type associated with this query root with equivalent optimized version.

public virtual EntityQueryRootExpression UpdateEntityType(IEntityType entityType)

Parameters

entityType IEntityType

The entity type to replace with.

Returns

EntityQueryRootExpression

New query root containing given entity type.

VisitChildren(ExpressionVisitor)

protected override Expression VisitChildren(ExpressionVisitor visitor)

Parameters

visitor ExpressionVisitor

Returns

Expression