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.

Queryable標準查詢運算子方法會傳回單一結果呼叫ExecuteThe Queryable standard query operator methods that return singleton results call Execute. 他們將它傳遞MethodCallExpression表示LINQLINQ查詢。They pass it a MethodCallExpression that represents a LINQLINQ query.

適用於