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
See Implementation of database providers and extensions and How EF Core queries work for more information and examples.
Constructors
EntityQueryRootExpression(IEntityType)
Creates a new instance of the EntityQueryRootExpression class without any query provider.
public EntityQueryRootExpression(IEntityType entityType)
Parameters
entityType
IEntityTypeThe 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
IAsyncQueryProviderThe query provider associated with this query root.
entityType
IEntityTypeThe entity type this query root represents.
Properties
CanReduce
public override bool CanReduce { get; }
Property Value
EntityType
The entity type represented by this query root.
public virtual IEntityType EntityType { get; }
Property Value
NodeType
public override ExpressionType NodeType { get; }
Property Value
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
GetHashCode()
public override int GetHashCode()
Returns
Print(ExpressionPrinter)
Creates a printable string representation of the given expression using ExpressionPrinter.
protected override void Print(ExpressionPrinter expressionPrinter)
Parameters
expressionPrinter
ExpressionPrinterThe 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
IEntityTypeThe 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