IQueryProvider.Execute 方法

定義

多載

Execute(Expression)

執行指定之運算式樹狀架構所代表的查詢。Executes the query represented by a specified expression tree.

Execute<TResult>(Expression)

執行由指定之運算式樹狀架構所代表的強型別查詢。Executes the strongly-typed query represented by a specified expression tree.

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

代表 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)

執行由指定之運算式樹狀架構所代表的強型別查詢。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

代表 LINQLINQ 查詢的運算式樹狀架構。An expression tree that represents a LINQLINQ query.

傳回

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單一結果呼叫Execute的標準查詢運算子方法。The Queryable standard query operator methods that return singleton results call Execute. 它們會傳遞MethodCallExpression LINQLINQ代表查詢的。They pass it a MethodCallExpression that represents a LINQLINQ query.

適用於