IQueryProvider.Execute IQueryProvider.Execute IQueryProvider.Execute Method

定义

重载

Execute(Expression) Execute(Expression) Execute(Expression)

执行指定表达式树所表示的查询。Executes the query represented by a specified expression tree.

Execute<TResult>(Expression) Execute<TResult>(Expression) Execute<TResult>(Expression)

执行指定表达式树所表示的强类型查询。Executes the strongly-typed query represented by a specified expression tree.

Execute(Expression) Execute(Expression) Execute(Expression)

执行指定表达式树所表示的查询。Executes the query represented by a specified expression tree.

public:
 System::Object ^ Execute(System::Linq::Expressions::Expression ^ expression);
public object Execute (System.Linq.Expressions.Expression expression);
abstract member Execute : System.Linq.Expressions.Expression -> obj

参数

expression
Expression Expression Expression

表示 LINQLINQ 查询的表达式目录树。An expression tree that represents a LINQLINQ query.

返回

执行指定查询所生成的值。The value that results from executing the specified query.

注解

Execute方法执行返回单个值 (而不是值的可枚举序列) 的查询。The Execute method executes queries that return a single value (instead of an enumerable sequence of values). 枚举其关联IQueryable的对象时, 将执行表示返回可枚举结果的查询的表达式树。Expression trees that represent queries that return enumerable results are executed when their associated IQueryable object is enumerated.

Execute<TResult>(Expression) Execute<TResult>(Expression) Execute<TResult>(Expression)

执行指定表达式树所表示的强类型查询。Executes the strongly-typed query represented by a specified expression tree.

public:
generic <typename TResult>
 TResult Execute(System::Linq::Expressions::Expression ^ expression);
public TResult Execute<TResult> (System.Linq.Expressions.Expression expression);
abstract member Execute : System.Linq.Expressions.Expression -> 'Result

类型参数

TResult

执行查询所生成的值的类型。The type of the value that results from executing the query.

参数

expression
Expression Expression Expression

表示 LINQLINQ 查询的表达式目录树。An expression tree that represents a LINQLINQ query.

返回

TResult TResult TResult

执行指定查询所生成的值。The value that results from executing the specified query.

注解

Execute方法执行返回单个值 (而不是值的可枚举序列) 的查询。The Execute method executes queries that return a single value (instead of an enumerable sequence of values). 当枚举包含表达式树的IQueryable<T>对象时, 将执行表示返回可枚举结果的查询的表达式树。Expression trees that represent queries that return enumerable results are executed when the IQueryable<T> object that contains the expression tree is enumerated.

返回单独结果调用Execute的标准查询运算符方法。QueryableThe Queryable standard query operator methods that return singleton results call Execute. 它们向其传递MethodCallExpression一个LINQLINQ表示查询的。They pass it a MethodCallExpression that represents a LINQLINQ query.

适用于