Share via


DataServiceContext.BeginSaveChanges Method (AsyncCallback, Object)

Asynchronously submits the pending changes to the data service collected by the DataServiceContext since the last time changes were saved.

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

Syntax

'Declaration
Public Function BeginSaveChanges ( _
    callback As AsyncCallback, _
    state As Object _
) As IAsyncResult
'Usage
Dim instance As DataServiceContext 
Dim callback As AsyncCallback 
Dim state As Object 
Dim returnValue As IAsyncResult 

returnValue = instance.BeginSaveChanges(callback, _
    state)
public IAsyncResult BeginSaveChanges(
    AsyncCallback callback,
    Object state
)
public:
IAsyncResult^ BeginSaveChanges(
    AsyncCallback^ callback, 
    Object^ state
)
member BeginSaveChanges : 
        callback:AsyncCallback * 
        state:Object -> IAsyncResult
public function BeginSaveChanges(
    callback : AsyncCallback, 
    state : Object
) : IAsyncResult

Parameters

  • state
    Type: System.Object
    The user-defined state object that is used to pass context data to the callback method.

Return Value

Type: System.IAsyncResult
An IAsyncResult that represents the status of the asynchronous operation.

Remarks

Changes are added to the DataServiceContext by calling the AddObject, AddLink, AttachTo, AttachLink, DeleteObject, DeleteLink, Detach, or DetachLink.

Changes are sent to the data service, as with the SaveChanges method, one change operation per HTTP request.

If an error occurs while processing an operation, no additional operations are processed by the data service. Instead, a response is generated telling the client what operations were executed, the results, and which operations were not tried because of an error.

See Also

Reference

DataServiceContext Class

BeginSaveChanges Overload

System.Data.Services.Client Namespace