IQueryProvider.CreateQuery Method

Definition

Overloads

CreateQuery(Expression)

Constructs an IQueryable object that can evaluate the query represented by a specified expression tree.

CreateQuery<TElement>(Expression)

Constructs an IQueryable<T> object that can evaluate the query represented by a specified expression tree.

CreateQuery(Expression)

Constructs an IQueryable object that can evaluate the query represented by a specified expression tree.

public:
 System::Linq::IQueryable ^ CreateQuery(System::Linq::Expressions::Expression ^ expression);
public System.Linq.IQueryable CreateQuery (System.Linq.Expressions.Expression expression);
abstract member CreateQuery : System.Linq.Expressions.Expression -> System.Linq.IQueryable

Parameters

expression
Expression

An expression tree that represents a LINQ query.

Returns

An IQueryable that can evaluate the query represented by the specified expression tree.

Remarks

Note

The Expression property of the returned IQueryable object is equal to expression.

The CreateQuery method is used to create new IQueryable objects, given an expression tree. The query that is represented by the returned object is associated with a specific LINQ provider.

Several of the standard query operator methods defined in Queryable, such as OfType and Cast, call this method. They pass it a MethodCallExpression that represents a LINQ query.

CreateQuery<TElement>(Expression)

Constructs an IQueryable<T> object that can evaluate the query represented by a specified expression tree.

public:
generic <typename TElement>
 System::Linq::IQueryable<TElement> ^ CreateQuery(System::Linq::Expressions::Expression ^ expression);
public System.Linq.IQueryable<TElement> CreateQuery<TElement> (System.Linq.Expressions.Expression expression);
abstract member CreateQuery : System.Linq.Expressions.Expression -> System.Linq.IQueryable<'Element>

Type Parameters

TElement

The type of the elements of the IQueryable<T> that is returned.

Parameters

expression
Expression

An expression tree that represents a LINQ query.

Returns

IQueryable<TElement>

An IQueryable<T> that can evaluate the query represented by the specified expression tree.

Remarks

Note

The Expression property of the returned IQueryable<T> object is equal to expression.

The CreateQuery method is used to create new IQueryable<T> objects, given an expression tree. The query that is represented by the returned object is associated with a specific LINQ provider.

Most of the Queryable standard query operator methods that return enumerable results call this method. They pass it a MethodCallExpression that represents a LINQ query.

Applies to