Skip to main content
IQueryable Interface
 

Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified.

Namespace:   System.Linq
Assembly:  System.Core (in System.Core.dll)

Syntax
public interface IQueryable : IEnumerable
public interface class IQueryable : IEnumerable
type IQueryable = 
    interface
        interface IEnumerable
    end
Public Interface IQueryable
	Inherits IEnumerable
Properties
NameDescription
System_CAPS_pubproperty

Gets the type of the element(s) that are returned when the expression tree associated with this instance of IQueryable is executed.

System_CAPS_pubproperty

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

System_CAPS_pubproperty

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

Methods
NameDescription
System_CAPS_pubmethod GetEnumerator

Returns an enumerator that iterates through a collection.(Inherited from IEnumerable.)

Extension Methods
NameDescription
System_CAPS_pubmethod AsParallel

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethod AsQueryable

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethod Cast

Converts the elements of an IQueryable to the specified type.(Defined by Queryable.)

System_CAPS_pubmethod OfType

Filters the elements of an IQueryable based on a specified type.(Defined by Queryable.)

Remarks

The IQueryable interface is intended for implementation by query providers. It is only supposed to be implemented by providers that also implement IQueryable. If the provider does not also implement IQueryable, the standard query operators cannot be used on the provider's data source.

The IQueryable interface inherits the IEnumerable interface so that if it represents a query, the results of that query can be enumerated. 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. Queries that do not return enumerable results are executed when the Execute method is called.

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

Version Information
Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.1
Windows Phone
Available since 8.1
Return to top