IQueryable IQueryable IQueryable IQueryable Interface

定義

提供功能,對未指定資料型別的特定資料來源評估查詢。Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified.

public interface class IQueryable : System::Collections::IEnumerable
public interface IQueryable : System.Collections.IEnumerable
type IQueryable = interface
    interface IEnumerable
Public Interface IQueryable
Implements IEnumerable
衍生
實作

備註

IQueryable介面是供查詢提供者執行。The IQueryable interface is intended for implementation by query providers. 它只應該由也IQueryable<T>會實作為的提供者來執行。It is only supposed to be implemented by providers that also implement IQueryable<T>. 如果提供者並未同時執行IQueryable<T>, 則標準查詢運算子不能用在提供者的資料來源上。If the provider does not also implement IQueryable<T>, the standard query operators cannot be used on the provider's data source.

IQueryable介面會IEnumerable繼承介面, 因此, 如果它代表查詢, 則可以列舉該查詢的結果。The IQueryable interface inherits the IEnumerable interface so that if it represents a query, the results of that query can be enumerated. 列舉會使與IQueryable物件相關聯的運算式樹狀架構執行。Enumeration causes the expression tree associated with an IQueryable object to be executed. 「執行運算式樹狀架構」的定義是查詢提供者特有的。The definition of "executing an expression tree" is specific to a query provider. 例如, 它可能牽涉到將運算式樹狀架構轉譯為基礎資料來源的適當查詢語言。For example, it may involve translating the expression tree to an appropriate query language for the underlying data source. 呼叫Execute方法時, 會執行未傳回可列舉結果的查詢。Queries that do not return enumerable results are executed when the Execute method is called.

如需如何建立您自己的 LINQ 提供者的詳細資訊, 請參閱 linq:在 MSDN blog 上建立 IQueryable 提供者。For more information about how to create your own LINQ provider, see LINQ: Building an IQueryable Provider on MSDN Blogs.

屬性

ElementType ElementType ElementType ElementType

取得與這個 IQueryable 執行個體關聯的運算式樹狀架構執行時,所傳回項目的型別。Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQueryable is executed.

Expression Expression Expression Expression

取得與 IQueryable 之執行個體關聯的運算式樹狀架構。Gets the expression tree that is associated with the instance of IQueryable.

Provider Provider Provider Provider

取得與這個資料來源關聯的查詢提供者。Gets the query provider that is associated with this data source.

方法

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through a collection.

(Inherited from IEnumerable)

擴充方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

Cast<TResult>(IQueryable) Cast<TResult>(IQueryable) Cast<TResult>(IQueryable) Cast<TResult>(IQueryable)

IQueryable 的項目轉換為指定的型別。Converts the elements of an IQueryable to the specified type.

OfType<TResult>(IQueryable) OfType<TResult>(IQueryable) OfType<TResult>(IQueryable) OfType<TResult>(IQueryable)

根據指定的型別來篩選 IQueryable 的項目。Filters the elements of an IQueryable based on a specified type.

適用於

另請參閱