Udostępnij za pośrednictwem


SelectExpression Class

Definition

An expression that represents a SELECT in a SQL tree.

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

public class SelectExpression : Microsoft.EntityFrameworkCore.Query.SqlExpressions.TableExpressionBase
public sealed class SelectExpression : Microsoft.EntityFrameworkCore.Query.SqlExpressions.TableExpressionBase
[System.Diagnostics.DebuggerDisplay("{PrintShortSql(), nq}")]
public sealed class SelectExpression : Microsoft.EntityFrameworkCore.Query.SqlExpressions.TableExpressionBase
type SelectExpression = class
    inherit TableExpressionBase
[<System.Diagnostics.DebuggerDisplay("{PrintShortSql(), nq}")>]
type SelectExpression = class
    inherit TableExpressionBase
Public Class SelectExpression
Inherits TableExpressionBase
Public NotInheritable Class SelectExpression
Inherits TableExpressionBase
Inheritance
SelectExpression
Attributes

Remarks

This class is not publicly constructable. If this is a problem for your application or provider, then please file an issue at github.com/dotnet/efcore.

Constructors

SelectExpression(JsonQueryExpression, TableExpressionBase, String, Type, RelationalTypeMapping)

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.

SelectExpression(List<TableExpressionBase>, Expression, List<ValueTuple<ColumnExpression,ValueComparer>>, SqlAliasManager)

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.

SelectExpression(SqlExpression, SqlAliasManager)

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.

SelectExpression(String, IReadOnlyList<TableExpressionBase>, SqlExpression, IReadOnlyList<SqlExpression>, SqlExpression, IReadOnlyList<ProjectionExpression>, Boolean, IReadOnlyList<OrderingExpression>, SqlExpression, SqlExpression, IReadOnlySet<String>, IReadOnlyDictionary<String,IAnnotation>)

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.

SelectExpression(String, List<TableExpressionBase>, SqlExpression, List<SqlExpression>, SqlExpression, List<ProjectionExpression>, Boolean, List<OrderingExpression>, SqlExpression, SqlExpression, ISet<String>, IReadOnlyDictionary<String,IAnnotation>, SqlAliasManager, Boolean)

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.

SelectExpression(TableExpressionBase, String, Type, RelationalTypeMapping, Nullable<Boolean>, String, Type, RelationalTypeMapping)

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.

Properties

Alias

The alias assigned to this table source.

(Inherited from TableExpressionBase)
Annotations

An indexed collection of annotations associated with this table expression.

(Inherited from TableExpressionBase)
DebugView

Expand this property in the debugger for a human-readable representation of this SelectExpression.

Warning: Do not rely on the format of the debug strings. They are designed for debugging only and may change arbitrarily between releases.

GroupBy

The SQL GROUP BY clause for the SELECT.

Having

The HAVING predicate for the SELECT when GroupBy clause exists.

IsDistinct

A bool value indicating if DISTINCT is applied to projection of this SelectExpression.

Limit

The limit applied to the number of rows in the result set.

NodeType (Inherited from TableExpressionBase)
Offset

The offset to skip rows from the result set.

Orderings

The list of orderings used to sort the result set.

Predicate

The WHERE predicate for the SELECT.

Projection

The list of expressions being projected out from the result set.

Tables

The list of tables sources used to generate the result set.

Tags

The list of tags applied to this SelectExpression.

Type (Inherited from TableExpressionBase)

Methods

AddAnnotation(String, Object)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

AddAnnotation(String, Object)

Adds an annotation to this object. Throws if an annotation with the specified name already exists.

(Inherited from TableExpressionBase)
AddCollectionProjection(ShapedQueryExpression, INavigation, Type)
AddCollectionProjection(ShapedQueryExpression, INavigationBase, Type)

Adds a collection to the projection of the SelectExpression.

AddCrossApply(SelectExpression, Type)
Obsolete.

Adds the given SelectExpression to table sources using CROSS APPLY.

AddCrossApply(SelectExpression)

Adds the given SelectExpression to table sources using CROSS APPLY.

AddCrossApply(ShapedQueryExpression, Expression)

Adds the query expression of the given ShapedQueryExpression to table sources using CROSS APPLY and combine shapers.

AddCrossJoin(SelectExpression, Type)
Obsolete.

Adds the given SelectExpression to table sources using CROSS JOIN.

AddCrossJoin(SelectExpression)

Adds the given SelectExpression to table sources using CROSS JOIN.

AddCrossJoin(ShapedQueryExpression, Expression)

Adds the query expression of the given ShapedQueryExpression to table sources using CROSS JOIN and combine shapers.

AddInnerJoin(SelectExpression, SqlExpression, Type)
Obsolete.

Adds the given SelectExpression to table sources using INNER JOIN.

AddInnerJoin(SelectExpression, SqlExpression)

Adds the given SelectExpression to table sources using INNER JOIN.

AddInnerJoin(ShapedQueryExpression, SqlExpression, Expression)

Adds the query expression of the given ShapedQueryExpression to table sources using INNER JOIN and combine shapers.

AddLeftJoin(SelectExpression, SqlExpression, Type)
Obsolete.

Adds the given SelectExpression to table sources using LEFT JOIN.

AddLeftJoin(SelectExpression, SqlExpression)

Adds the given SelectExpression to table sources using LEFT JOIN.

AddLeftJoin(ShapedQueryExpression, SqlExpression, Expression)

Adds the query expression of the given ShapedQueryExpression to table sources using LEFT JOIN and combine shapers.

AddOuterApply(SelectExpression, Type)
Obsolete.

Adds the given SelectExpression to table sources using OUTER APPLY.

AddOuterApply(SelectExpression)

Adds the given SelectExpression to table sources using OUTER APPLY.

AddOuterApply(ShapedQueryExpression, Expression)

Adds the query expression of the given ShapedQueryExpression to table sources using OUTER APPLY and combine shapers.

AddSingleProjection(ShapedQueryExpression)

Adds a non-scalar single result to the projection of the SelectExpression.

AddToProjection(EntityProjectionExpression)

Adds given EntityProjectionExpression to the projection.

AddToProjection(SqlExpression)

Adds given SqlExpression to the projection.

AppendOrdering(OrderingExpression)

Appends ordering to the existing orderings of the SelectExpression.

ApplyCollectionJoin(Int32, Int32, Expression, INavigation, Type)
ApplyCollectionJoin(Int32, Int32, Expression, INavigationBase, Type, Boolean)

Applies previously added collection projection.

ApplyDefaultIfEmpty(ISqlExpressionFactory)

Applies DefaultIfEmpty<TSource>(IQueryable<TSource>) on the SelectExpression.

ApplyDistinct()

Applies DISTINCT operator to the projections of the SelectExpression.

ApplyExcept(SelectExpression, Boolean)

Applies EXCEPT operation to the SelectExpression.

ApplyGrouping(Expression, Expression, ISqlExpressionFactory)

Applies grouping from given key selector and generate RelationalGroupByShaperExpression to shape results.

ApplyGrouping(Expression)

Applies grouping from given key selector.

ApplyIntersect(SelectExpression, Boolean)

Applies INTERSECT operation to the SelectExpression.

ApplyLimit(SqlExpression)

Applies limit to the SelectExpression to limit the number of rows returned in the result set.

ApplyOffset(SqlExpression)

Applies offset to the SelectExpression to skip the number of rows in the result set.

ApplyOrdering(OrderingExpression)

Applies ordering to the SelectExpression. This overwrites any previous ordering specified.

ApplyPredicate(SqlExpression)

Applies filter predicate to the SelectExpression.

ApplyProjection()

Adds expressions from projection mapping to projection ignoring the shaper expression. This method should only be used when populating projection in subquery.

ApplyProjection(Expression, ResultCardinality, QuerySplittingBehavior)

Adds expressions from projection mapping to projection and generate updated shaper expression for materialization.

ApplyTags(ISet<String>)

Applies a given set of tags.

ApplyUnion(SelectExpression, Boolean)

Applies UNION operation to the SelectExpression.

AssignUniqueAliases(SqlExpression)

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.

ClearOrdering()

Clears existing orderings.

ClearProjection()
Obsolete.

Clears all existing projections.

Clone()

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.

Clone(String, ExpressionVisitor)

Creates a new object that is a copy of the current instance.

Clone(String, ExpressionVisitor)

Creates a new object that is a copy of the current instance.

(Inherited from TableExpressionBase)
CreateColumnExpression(TableExpressionBase, String, Type, RelationalTypeMapping, Nullable<Boolean>)

Creates a ColumnExpression that references a table on this SelectExpression.

CreateImmutable(String, List<TableExpressionBase>, List<ProjectionExpression>)

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.

CreateWithAnnotations(IEnumerable<IAnnotation>)

Creates an object like this with specified annotations.

(Inherited from TableExpressionBase)
Equals(Object) System.Linq.Expressions.Expression.Equals(System.Object)
FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

FindAnnotation(String)

Gets the annotation with the given name, returning null if it does not exist.

(Inherited from TableExpressionBase)
GenerateComplexPropertyShaperExpression(StructuralTypeProjectionExpression, IComplexProperty)

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.

GenerateOwnedReferenceEntityProjectionExpression(EntityProjectionExpression, INavigation, ISqlExpressionFactory)

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.

GenerateOwnedReferenceEntityProjectionExpression(StructuralTypeProjectionExpression, INavigation, ISqlExpressionFactory, SqlAliasManager)

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.

GenerateOwnedReferenceEntityProjectionExpression(StructuralTypeProjectionExpression, INavigation, ISqlExpressionFactory)

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.

GenerateWeakEntityProjectionExpression(IEntityType, ITableBase, String, TableExpressionBase, Boolean)

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.

GetAnnotations()

Gets all annotations on the current object.

GetAnnotations()

Gets all annotations on the current object.

(Inherited from TableExpressionBase)
GetHashCode() System.Linq.Expressions.Expression.GetHashCode
GetMappedProjection(ProjectionMember)
Obsolete.

Gets the projection mapped to the given ProjectionMember.

GetProjection(ProjectionBindingExpression)

Gets the projection mapped to the given ProjectionBindingExpression.

GetRequiredAlias()

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.

(Inherited from TableExpressionBase)
GetTable(ColumnExpression)

Retrieves the TableExpressionBase referenced by the given column, looking it up on this SelectExpression based on its alias.

IsNonComposedFromSql()

Checks whether this SelectExpression represents a FromSqlExpression which is not composed upon.

PrepareForAggregate()

Prepares the SelectExpression to apply aggregate operation over it.

PrepareForAggregate(Boolean)

Prepares the SelectExpression to apply aggregate operation over it.

Print(ExpressionPrinter)

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

Print(ExpressionPrinter)

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

(Inherited from TableExpressionBase)
PrintAnnotations(ExpressionPrinter)

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

(Inherited from TableExpressionBase)
Prune()

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.

PushdownIntoSubquery()

Pushes down the SelectExpression into a subquery.

Quote() System.Linq.Expressions.Expression.Quote
Quote()

Quotes the expression; that is, returns an expression that, when evaluated, would construct an expression identical to this one. Used to generate code for precompiled queries, which reconstructs this expression.

(Inherited from TableExpressionBase)
RemoveTpcTableExpression()

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.

ReplaceProjection(IReadOnlyDictionary<ProjectionMember,Expression>)

Replaces current projection mapping with a new one to change what is being projected out from this SelectExpression.

ReplaceProjection(IReadOnlyList<Expression>)

Replaces current projection mapping with a new one to change what is being projected out from this SelectExpression.

ReplaceProjectionMapping(IDictionary<ProjectionMember,Expression>)
Obsolete.

Replaces current projection mapping with a new one to change what is being projected out from this SelectExpression.

ReverseOrderings()

Reverses the existing orderings on the SelectExpression.

Update(IReadOnlyList<ProjectionExpression>, IReadOnlyList<TableExpressionBase>, SqlExpression, IReadOnlyList<SqlExpression>, SqlExpression, IReadOnlyList<OrderingExpression>, SqlExpression, SqlExpression, Boolean, String)
Obsolete.

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.

Update(IReadOnlyList<ProjectionExpression>, IReadOnlyList<TableExpressionBase>, SqlExpression, IReadOnlyList<SqlExpression>, SqlExpression, IReadOnlyList<OrderingExpression>, SqlExpression, SqlExpression)

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.

Update(IReadOnlyList<TableExpressionBase>, SqlExpression, IReadOnlyList<SqlExpression>, SqlExpression, IReadOnlyList<ProjectionExpression>, IReadOnlyList<OrderingExpression>, SqlExpression, SqlExpression)

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.

Update(List<ProjectionExpression>, List<TableExpressionBase>, SqlExpression, List<SqlExpression>, SqlExpression, List<OrderingExpression>, SqlExpression, SqlExpression, Boolean, String)
Obsolete.

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.

Update(List<ProjectionExpression>, List<TableExpressionBase>, SqlExpression, List<SqlExpression>, SqlExpression, List<OrderingExpression>, SqlExpression, SqlExpression)

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.

VisitChildren(ExpressionVisitor) (Inherited from TableExpressionBase)
WithAlias(String)

Returns a copy of the current TableExpressionBase with the new provided alias.

WithAlias(String)

Returns a copy of the current TableExpressionBase with the new provided alias.

(Inherited from TableExpressionBase)
WithAnnotations(IReadOnlyDictionary<String,IAnnotation>)

Creates an object like this with specified annotations.

(Inherited from TableExpressionBase)

Explicit Interface Implementations

IPrintableExpression.Print(ExpressionPrinter)

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

(Inherited from TableExpressionBase)

Extension Methods

UnwrapJoin(TableExpressionBase)

If the given table is a JoinExpressionBase, returns the table it joins to. Otherwise, returns table.

Applies to