Udostępnij za pośrednictwem


DataServiceContext.BeginExecuteBatch Method

Asynchronously submits a group of queries as a batch to the data service.

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

Syntax

'Declaration
Public Function BeginExecuteBatch ( _
    callback As AsyncCallback, _
    state As Object, _
    ParamArray queries As DataServiceRequest() _
) As IAsyncResult
'Usage
Dim instance As DataServiceContext 
Dim callback As AsyncCallback 
Dim state As Object 
Dim queries As DataServiceRequest()
Dim returnValue As IAsyncResult 

returnValue = instance.BeginExecuteBatch(callback, _
    state, queries)
public IAsyncResult BeginExecuteBatch(
    AsyncCallback callback,
    Object state,
    params DataServiceRequest[] queries
)
public:
IAsyncResult^ BeginExecuteBatch(
    AsyncCallback^ callback, 
    Object^ state, 
    ... array<DataServiceRequest^>^ queries
)
member BeginExecuteBatch : 
        callback:AsyncCallback * 
        state:Object * 
        queries:DataServiceRequest[] -> IAsyncResult
public function BeginExecuteBatch(
    callback : AsyncCallback, 
    state : Object, 
    ... queries : DataServiceRequest[]
) : IAsyncResult

Parameters

  • callback
    Type: System.AsyncCallback
    The delegate that is called when a response to the batch request is received.
  • state
    Type: System.Object
    User-defined state object that is used to pass context data to the callback method.

Return Value

Type: System.IAsyncResult
An IAsyncResult 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 queries are specified as DataServiceRequest<TElement> instances. Returns a DataServiceResponse that represents the response of the batch request as a whole. Individual query responses are represented as DataServiceResponse objects that can be accessed by enumerating the DataServiceResponse instance.

When this method returns, all of the HTTP response for the batch request has been read from the network stream but the responses have not been processed. No identity resolution or object materialization occurs for a specified entity in the response until it is enumerated.

See Also

Reference

DataServiceContext Class

System.Data.Services.Client Namespace