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.

static (Shared Visual Basic 中) 類別中定義的方法Queryable(除了AsQueryableThenBy,和ThenByDescending) 擴充物件的類型可實作IQueryable<T>介面。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:建置 IQueryable 提供者MSDN 部落格上。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)

Extension Methods

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

傳回DataTable,其中包含副本DataRow物件,指定輸入IEnumerable<T>物件其中泛型參數TDataRowReturns 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至指定的物件DataTable,根據輸入IEnumerable<T>物件其中泛型參數TDataRowCopies 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至指定的物件DataTable,根據輸入IEnumerable<T>物件其中泛型參數TDataRowCopies 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)

將轉換IEnumerableIQueryableConverts 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.

適用於

另請參閱