Share via


DataServiceContext.BeginExecute<TElement> Method (Uri, AsyncCallback, Object)

Asynchronously sends the request so that this call does not block processing while waiting for the results from the service.

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

Syntax

'Declaration
Public Function BeginExecute(Of TElement) ( _
    requestUri As Uri, _
    callback As AsyncCallback, _
    state As Object _
) As IAsyncResult
'Usage
Dim instance As DataServiceContext 
Dim requestUri As Uri 
Dim callback As AsyncCallback 
Dim state As Object 
Dim returnValue As IAsyncResult 

returnValue = instance.BeginExecute(requestUri, _
    callback, state)
public IAsyncResult BeginExecute<TElement>(
    Uri requestUri,
    AsyncCallback callback,
    Object state
)
public:
generic<typename TElement>
IAsyncResult^ BeginExecute(
    Uri^ requestUri, 
    AsyncCallback^ callback, 
    Object^ state
)
member BeginExecute : 
        requestUri:Uri * 
        callback:AsyncCallback * 
        state:Object -> IAsyncResult
JScript does not support generic types and methods.

Type Parameters

  • TElement
    The type returned by the query.

Parameters

  • requestUri
    Type: System.Uri
    The URI to which the query request will be sent. The URI may be any valid data service URI; it can contain $ query parameters.
  • callback
    Type: System.AsyncCallback
    Delegate to invoke when results are available for client consumption.
  • state
    Type: System.Object
    User-defined state object passed to the callback.

Return Value

Type: System.IAsyncResult
An object that is used to track the status of the asynchronous operation.

Remarks

The returned IAsyncResult object is used to determine when the asynchronous operation has completed. For more information, see Asynchronous Operations (WCF Data Services).

The method BeginExecute uses the same semantics as Execute, however this method asynchronously sends the request so that this call does not block processing while waiting for the results from the service. According to the standard begin-end asynchronous pattern, the provided callback is invoked when query results are retrieved.

See Also

Reference

DataServiceContext Class

BeginExecute Overload

System.Data.Services.Client Namespace

Other Resources

How to: Execute Asynchronous Data Service Queries (WCF Data Services)