Share via


SqlTreePruner.PruneSelect(SelectExpression, Boolean) Method

Definition

Prunes a SelectExpression, removes tables inside it which aren't referenced, and optionally also projections which aren't referenced from outside it.

[Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkInternal]
protected virtual Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression PruneSelect (Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression select, bool preserveProjection);
[<Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkInternal>]
abstract member PruneSelect : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression * bool -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression
override this.PruneSelect : Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression * bool -> Microsoft.EntityFrameworkCore.Query.SqlExpressions.SelectExpression
Protected Overridable Function PruneSelect (select As SelectExpression, preserveProjection As Boolean) As SelectExpression

Parameters

select
SelectExpression

The SelectExpression to prune.

preserveProjection
Boolean

Whether to prune projections if they aren't referenced from the outside.

Returns

A pruned copy of select, or the same instance of nothing was pruned.

Attributes

Remarks

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Applies to