IQueryable<T> Interface

Definition

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

Type Parameters

T

The type of the data in the data source.

Derived
Implements

Remarks

The IQueryable<T> interface is intended for implementation by query providers.

This interface inherits the IEnumerable<T> interface so that if it represents a query, the results of that query can be enumerated. Enumeration forces the expression tree associated with an IQueryable<T> object to be executed. 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.

The IQueryable<T> interface enables queries to be polymorphic. 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.

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.

For more information about how to create your own LINQ provider, see LINQ: Building an IQueryable Provider on MSDN Blogs.

Properties

ElementType

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

Gets the expression tree that is associated with the instance of IQueryable.

(Inherited from IQueryable)
Provider

Gets the query provider that is associated with this data source.

(Inherited from IQueryable)

Methods

GetEnumerator()

Returns an enumerator that iterates through a collection.

(Inherited from IEnumerable)

Extension Methods

CopyToDataTable<T>(IEnumerable<T>)

Returns 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)

Copies 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)

Copies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Cast<TResult>(IQueryable)

Converts the elements of an IQueryable to the specified type.

OfType<TResult>(IQueryable)

Filters the elements of an IQueryable based on a specified type.

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

Specifies a sort order.

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)

Returns a filtered collection of elements that contains the ancestors of every node in the source collection. Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

Returns a collection of the descendant nodes of every document and element in the source collection.

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)

Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

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)

Returns a filtered collection of the child elements of every element and document in the source collection. Only elements that have a matching XName are included in the collection.

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

Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

Removes every node in the source collection from its parent node.

Applies to

See also