DataServiceQuery<TElement> 类

定义

表示对数据服务的单一查询请求。Represents a single query request to a data service.

generic <typename TElement>
public ref class DataServiceQuery : System::Data::Services::Client::DataServiceQuery, System::Collections::Generic::IEnumerable<TElement>, System::Linq::IQueryable<TElement>
public class DataServiceQuery<TElement> : System.Data.Services.Client.DataServiceQuery, System.Collections.Generic.IEnumerable<TElement>, System.Linq.IQueryable<TElement>
type DataServiceQuery<'Element> = class
    inherit DataServiceQuery
    interface IQueryable<'Element>
    interface seq<'Element>
    interface IEnumerable
    interface IQueryable
Public Class DataServiceQuery(Of TElement)
Inherits DataServiceQuery
Implements IEnumerable(Of TElement), IQueryable(Of TElement)

类型参数

TElement

查询所返回结果的类型。Type of results returned by the query.

继承
DataServiceQuery<TElement>
实现

注解

此类未定义公共构造函数。No public constructors are defined on this class. 对象实例是使用 CreateQuery 类的 CreateQueryDataServiceContext 方法创建的。Object instances are created by using CreateQuery or CreateQuery on the DataServiceContext class.

属性

ElementType

返回模板中用于创建 DataServiceQuery<TElement> 实例的对象的类型。Returns the type of the object used in the template to create the DataServiceQuery<TElement> instance.

Expression

表示一个表达式,其中包含对数据服务的查询。Represents an expression containing the query to the data service.

Provider

表示查询提供程序实例。Represents the query provider instance.

RequestUri

获取查询的 URI。Get the URI for the query.

方法

AddQueryOption(String, Object)

创建新的 DataServiceQuery<TElement>,并在由返回的查询生成的 URI 中设置查询选项。Creates a new DataServiceQuery<TElement> with the query option set in the URI generated by the returned query.

BeginExecute(AsyncCallback, Object)

启动异步网络操作,以便执行此对象实例所表示的查询。Starts an asynchronous network operation that executes the query represented by this object instance.

EndExecute(IAsyncResult)

结束对数据服务的异步查询请求。Ends an asynchronous query request to a data service.

Equals(Object)

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

(继承自 Object)
Execute()

执行查询,并以实现 IEnumerable 的集合的形式返回结果。Executes the query and returns the results as a collection that implements IEnumerable.

Expand(String)

使用扩展选项(在由返回的查询所生成的 URI 中设置)创建新的 DataServiceQuery<TElement>Creates a new DataServiceQuery<TElement> with the expand option set in the URI generated by the returned query.

GetEnumerator()

执行查询并以集合的形式返回结果。Executes the query and returns the results as a collection.

GetHashCode()

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

(继承自 Object)
GetType()

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

(继承自 Object)
IncludeTotalCount()

请求在查询结果中以内联方式返回实体集中的所有实体的计数。Requests that the count of all entities in the entity set be returned inline with the query results.

MemberwiseClone()

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

(继承自 Object)
ToString()

表示对数据服务的查询的 URI。Represents the URI of the query to the data service.

显式界面实现

IEnumerable.GetEnumerator()

执行查询并以集合的形式返回结果。Executes the query and returns the results as a collection.

扩展方法

CopyToDataTable<T>(IEnumerable<T>)

在给定其泛型参数 TDataTable 的输入 DataRow 对象的情况下,返回包含 IEnumerable<T> 对象副本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 IEnumerable<T> 对象复制到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

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.

SortBy<T>(IQueryable<T>, String)

指定排序顺序。Specifies a sort order.

Ancestors<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个节点的上级。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个节点的上级。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子代节点的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>)

返回元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName)

返回经过筛选的元素集合,其中包含源集合中每个元素和文档的子代元素。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>)

返回源集合中每个元素和文档的子元素的集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName)

返回源集合中经过筛选的每个元素和文档的子元素集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中仅包括具有匹配 XName 的元素。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>)

返回节点集合(其中包含源集合中的所有节点),并按文档顺序排列。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子节点集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

将源集合中的每个节点从其父节点中移除。Removes every node in the source collection from its parent node.

适用于