Share via


DataServiceQuery<TElement> Class

Represents a single query request to a data service.

Inheritance Hierarchy

System.Object
  System.Data.Services.Client.DataServiceRequest
    System.Data.Services.Client.DataServiceQuery
      System.Data.Services.Client.DataServiceQuery<TElement>

Namespace:  System.Data.Services.Client
Assembly:  Microsoft.Data.Services.Client (in Microsoft.Data.Services.Client.dll)

Syntax

'Declaration
Public Class DataServiceQuery(Of TElement) _
    Inherits DataServiceQuery _
    Implements IQueryable(Of TElement), IEnumerable(Of TElement),  _
    IQueryable, IEnumerable
'Usage
Dim instance As DataServiceQuery(Of TElement)
public class DataServiceQuery<TElement> : DataServiceQuery, 
    IQueryable<TElement>, IEnumerable<TElement>, IQueryable, IEnumerable
generic<typename TElement>
public ref class DataServiceQuery : public DataServiceQuery, 
    IQueryable<TElement>, IEnumerable<TElement>, IQueryable, IEnumerable
type DataServiceQuery<'TElement> =  
    class 
        inherit DataServiceQuery 
        interface IQueryable<'TElement>
        interface IEnumerable<'TElement>
        interface IQueryable 
        interface IEnumerable 
    end
JScript does not support generic types and methods.

Type Parameters

  • TElement
    Type of results returned by the query.

The DataServiceQuery<TElement> type exposes the following members.

Properties

  Name Description
Public property ElementType Returns the type of the object used in the template to create the DataServiceQuery<TElement> instance. (Overrides DataServiceRequest.ElementType.)
Public property Expression Represents an expression containing the query to the data service. (Overrides DataServiceQuery.Expression.)
Public property Provider Represents the query provider instance. (Overrides DataServiceQuery.Provider.)
Public property RequestUri Get the URI for the query. (Overrides DataServiceRequest.RequestUri.)

Top

Methods

  Name Description
Public method AddQueryOption Creates a new DataServiceQuery<TElement> with the query option set in the URI generated by the returned query.
Public method BeginExecute Starts an asynchronous network operation that executes the query represented by this object instance.
Public method EndExecute Ends an asynchronous query request to a data service.
Public method Equals (Inherited from Object.)
Public method Execute Executes the query and returns the results as a collection that implements IEnumerable.Not supported by the WCF Data Services 5.0 client for Silverlight.
Public method Expand(String) Expands a query to include entities from a related entity set in the query response.
Public method Expand<TTarget>(Expression<Func<TElement, TTarget>>) Expands a query to include entities from a related entity set in the query response, where the related entity is of a specific type in a type hierarchy.
Protected method Finalize (Inherited from Object.)
Public method GetEnumerator Executes the query and returns the results as a collection.
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Public method IncludeTotalCount Requests that the count of all entities in the entity set be returned inline with the query results.
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString Represents the URI of the query to the data service. (Overrides Object.ToString().)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IEnumerable.GetEnumerator Executes the query and returns the results as a collection.
Explicit interface implemetationPrivate method IEnumerable<TElement>.GetEnumerator Executes the query and returns the result as a collection.Supported only by the WCF Data Services 5.0 client for Silverlight.

Top

Remarks

No public constructors are defined on this class. Object instances are created by using CreateQuery``1(Uri) or CreateQuery<T> on the DataServiceContext class.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Data.Services.Client Namespace