IQueryable<T> IQueryable<T> IQueryable<T> IQueryable<T> Interface

定義

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

generic <typename T>
public interface class IQueryable : System::Collections::Generic::IEnumerable<T>, System::Linq::IQueryable
public interface IQueryable<out T> : System.Collections.Generic.IEnumerable<out T>, System.Linq.IQueryable
type IQueryable<'T> = interface
    interface seq<'T>
    interface IQueryable
    interface IEnumerable
Public Interface IQueryable(Of Out T)
Implements IEnumerable(Of Out T), IQueryable

類型參數

T

資料來源中的資料型別。The type of the data in the data source.

衍生
實作

備註

IQueryable<T>介面是供查詢提供者執行。The IQueryable<T> interface is intended for implementation by query providers.

這個介面會繼承IEnumerable<T>介面, 如果它代表查詢, 則可以列舉該查詢的結果。This interface inherits the IEnumerable<T> interface so that if it represents a query, the results of that query can be enumerated. 列舉會強制執行與IQueryable<T>物件相關聯的運算式樹狀架構。Enumeration forces the expression tree associated with an IQueryable<T> object to be executed. 呼叫Execute<TResult>(Expression)方法時, 會執行未傳回可列舉結果的查詢。Queries that do not return enumerable results are executed when the Execute<TResult>(Expression) method is called.

「執行運算式樹狀架構」的定義是查詢提供者特有的。The definition of "executing an expression tree" is specific to a query provider. 例如, 它可能牽涉到將運算式樹狀架構轉譯為適用于基礎資料來源的查詢語言。For example, it may involve translating the expression tree to a query language appropriate for an underlying data source.

介面IQueryable<T>可讓查詢成為多型的。The IQueryable<T> interface enables queries to be polymorphic. 也就是說, 因為對IQueryable資料來源的查詢是以運算式樹狀架構來表示, 所以可以針對不同類型的資料來源來執行。That is, because a query against an IQueryable data source is represented as an expression tree, it can be executed against different types of data sources.

Shared AsQueryable ThenBy ThenByDescending IQueryable<T>在類別static 中定義的(在VisualBasic)方法中(、和除外)會擴充實作為介面之Queryable類型的物件。The static (Shared in Visual Basic) methods defined in the class Queryable (except for AsQueryable, ThenBy, and ThenByDescending) extend objects of types that implement the IQueryable<T> interface.

如需如何建立您自己的 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.

方法

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

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

(Inherited from IEnumerable)

屬性

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.

(Inherited from IQueryable)

Expression Expression Expression Expression

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

(Inherited from IQueryable)

Provider Provider Provider Provider

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

(Inherited from IQueryable)

擴充方法

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>)

根據輸入 DataTable 物件 (其中泛型參數 TDataRow) 傳回包含 IEnumerable<T> 物件複本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

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.

SortBy<T>(IQueryable<T>, String) SortBy<T>(IQueryable<T>, String) SortBy<T>(IQueryable<T>, String) SortBy<T>(IQueryable<T>, String)

指定排序順序。Specifies a sort order.

Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>)

傳回包含來源集合中每個節點祖系的項目集合。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName)

傳回包含來源集合中每個節點祖系的已篩選項目集合。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目之子代節點的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>)

傳回包含來源集合中每個項目和文件之子代項目的項目集合。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName)

傳回已篩選的項目集合,其中包含來源集合中每個項目和文件的子代項目。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>)

傳回來源集合中每個項目和文件的子項目集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName)

傳回來源集合中每個項目和文件的已篩選子項目集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>)

傳回包含來源集合中所有節點的節點集合,依據文件順序來排序。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目的子節點集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>)

在來源集合中,從每一個節點的父節點移除這些節點。Removes every node in the source collection from its parent node.

適用於

另請參閱