ObjectQuery ObjectQuery ObjectQuery ObjectQuery Class


实现使用 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 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 CommandText CommandText CommandText

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

Context Context Context Context

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

EnablePlanCaching EnablePlanCaching EnablePlanCaching EnablePlanCaching

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

MergeOption MergeOption MergeOption MergeOption

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

Parameters Parameters Parameters Parameters

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


Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
Execute(MergeOption) Execute(MergeOption) Execute(MergeOption) Execute(MergeOption)

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

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetResultType() GetResultType() GetResultType() GetResultType()

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

GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
ToTraceString() ToTraceString() ToTraceString() ToTraceString()

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


IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

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

IListSource.ContainsListCollection IListSource.ContainsListCollection IListSource.ContainsListCollection IListSource.ContainsListCollection

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

IListSource.GetList() IListSource.GetList() IListSource.GetList() IListSource.GetList()

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

IQueryable.ElementType IQueryable.ElementType IQueryable.ElementType IQueryable.ElementType

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

IQueryable.Expression IQueryable.Expression IQueryable.Expression IQueryable.Expression

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

IQueryable.Provider IQueryable.Provider IQueryable.Provider IQueryable.Provider

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


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.