DataServiceContext.ExecuteBatch Method (DataServiceRequest[])

 

Submits a group of queries as a batch to the data service.

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

member ExecuteBatch : 
        [<ParamArrayAttribute>] queries:DataServiceRequest[] -> DataServiceResponse

Parameters

queries
Type: System.Data.Services.Client.DataServiceRequest[]

Array of T:System.Data.Services.Client.DataServiceRequest[] objects that make up the queries.

Return Value

Type: System.Data.Services.Client.DataServiceResponse

The response to the batch operation.

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 individual OperationResponse objects that can be accessed by enumerating the DataServiceResponse instance.

When this method returns the whole 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.

The following example shows how to call the M:Microsoft.SqlServer.ReportingServices.ReportingService.ExecuteBatch method to execute an array of DataServiceRequest<'TElement> objects that contains queries that return both Customers and Products objects from the Northwind data service. The collection of QueryOperationResponse<'T> objects in the returned DataServiceResponse is enumerated, and the collection of objects that is contained in each QueryOperationResponse<'T> is also enumerated. This example uses the DataServiceContext generated by the Add Service Reference tool based on the Northwind data service, which is created when you complete the WCF Data Services .

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.5
Return to top
Show: