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:生成 IQueryable 提供程序MSDN 博客上。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.

适用于

另请参阅