DataServiceContext.BeginExecuteBatch 方法
以非同步方式和批次方式將一組查詢送出至資料服務。
命名空間: System.Data.Services.Client
組件: Microsoft.Data.Services.Client (在 Microsoft.Data.Services.Client.dll 中)
語法
'宣告
Public Function BeginExecuteBatch ( _
callback As AsyncCallback, _
state As Object, _
ParamArray queries As DataServiceRequest() _
) As IAsyncResult
'用途
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
參數
- callback
型別:System.AsyncCallback
擷取對批次要求的回應時所呼叫的委派。
- state
型別:System.Object
使用者定義的狀態物件,用於將內容資料傳遞給回呼方法。
- queries
型別:array<System.Data.Services.Client.DataServiceRequest[]
要包含在批次要求中的查詢要求陣列。
傳回值
型別:System.IAsyncResult
用於追蹤非同步作業之狀態的 IAsyncResult 物件。
備註
傳回的 IAsyncResult 物件用來確定非同步作業已完成的時間。 如需詳細資訊,請參閱非同步作業 (WCF Data Services)。
這些查詢會指定為 DataServiceRequest<TElement> 執行個體。 這個方法會傳回表示整個批次要求之回應的 DataServiceResponse。 個別查詢回應表示為 DataServiceResponse 物件,可透過列舉 DataServiceResponse 執行個體存取這些物件。
當此方法傳回時,已從網路資料流讀取批次要求的完整 HTTP 回應,但尚未處理回應。 除非回應中的指定之實體經過列舉,否則不會對該實體進行任何識別 (Identity) 解析或物件具體化。