ObjectQuery 类

定义

实现使用 LINQ to Entities 和 ObjectQuery<T> 对概念模型执行查询的通用功能。Implements common functionality for queries against a conceptual model using both LINQ to Entities and ObjectQuery<T>.

public ref class ObjectQuery abstract : System::Collections::IEnumerable, System::ComponentModel::IListSource, System::Linq::IOrderedQueryable
public abstract class ObjectQuery : System.Collections.IEnumerable, System.ComponentModel.IListSource, System.Linq.IOrderedQueryable
type ObjectQuery = class
    interface IEnumerable
    interface IQueryable
    interface IOrderedQueryable
    interface IListSource
Public MustInherit Class ObjectQuery
Implements IEnumerable, IListSource, IOrderedQueryable
继承
ObjectQuery
派生
实现

注解

ObjectQuery是针对概念模型的查询的基类。ObjectQuery is the base class for queries against a conceptual model. ObjectQuery提供它是为了确保 LINQ to Entities 查询与使用ObjectQuery<T>执行的查询具有相同的功能。ObjectQuery is provided to ensure that LINQ to Entities queries have the same functionality as queries executed using ObjectQuery<T>. 必须使用ObjectQuery<T>具有指定类型的来查询概念模型。You must use ObjectQuery<T> with a specified type to query a conceptual model. 有关详细信息, 请参阅对象查询For more information, see Object Queries.

属性

CommandText

返回查询的命令文本。Returns the command text for the query.

Context

获取与此对象查询相关联的对象上下文。Gets the object context associated with this object query.

EnablePlanCaching

获取或设置一个值,该值指示是否应缓存查询计划。Gets or sets a value that indicates whether the query plan should be cached.

MergeOption

获取或设置从查询返回的对象添加到对象上下文的方式。Gets or sets how objects returned from a query are added to the object context.

Parameters

获取此对象查询的参数集合。Gets the parameter collection for this object query.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
Execute(MergeOption)

使用指定合并选项执行非类型化对象查询。Executes the untyped object query with the specified merge option.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetResultType()

返回有关查询的结果类型的信息。Returns information about the result type of the query.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)
ToTraceString()

返回对数据源执行的命令。Returns the commands to execute against the data source.

显式界面实现

IEnumerable.GetEnumerator()

返回循环访问集合的枚举数。Returns an enumerator that iterates through a collection.

IListSource.ContainsListCollection

获取一个值,该值指示查询返回的集合是否包含集合对象。Gets a value that indicates whether the collection returned by the query contains collection objects.

IListSource.GetList()

IList 形式返回一个集合,用于数据绑定。Returns the collection as an IList used for data binding.

IQueryable.ElementType

获取此查询实例的结果元素类型。Gets the result element type for this query instance.

IQueryable.Expression

获取描述此查询的表达式。Gets the expression describing this query.

IQueryable.Provider

获取与此查询实例关联的 LINQ IQueryProviderGets the LINQ IQueryProvider associated with this query instance.

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Cast<TResult>(IQueryable)

IQueryable 的元素转换为指定的类型。Converts the elements of an IQueryable to the specified type.

OfType<TResult>(IQueryable)

根据指定类型筛选 IQueryable 的元素。Filters the elements of an IQueryable based on a specified type.

适用于

另请参阅