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 IOrderedQueryable
    interface IQueryable
    interface IEnumerable
    interface IListSource
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()

傳回代表目前物件的字串。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()

傳回集合當做用於資料繫結 (Data Binding) 的 IListReturns 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.

適用於