DevForce Help Reference
SaveChangesAsync Method (EntityManagerPartialSaveExtensions)


The EntityManager holding entities to be persisted.
List of IdeaBlade.EntityModel.IEntity objects to be persisted
Options controlling save processing
Perform an asynchronous IdeaBlade.EntityModel.Compat.EntityManagerPartialSaveExtensions.SaveChanges(IdeaBlade.EntityModel.EntityManager,System.Collections.IEnumerable,IdeaBlade.EntityModel.SaveOptions) operation with the specified list of entities and IdeaBlade.EntityModel.SaveOptions.
Syntax
'Declaration
 
<AsyncStateMachineAttribute(IdeaBlade.EntityModel.Compat.EntityManagerPartialSaveExtensions+d__2)> 
<ExtensionAttribute()> 
Public Shared Function SaveChangesAsync( _ 
   ByVal entityManager As EntityManager, _ 
   ByVal entities As IEnumerable, _ 
   Optional ByVal saveOptions As SaveOptions _ 
) As Task
'Usage
 
Dim entityManager As EntityManager
Dim entities As IEnumerable
Dim saveOptions As SaveOptions
Dim value As Task
 
value = EntityManagerPartialSaveExtensions.SaveChangesAsync(entityManager, entities, saveOptions)
[AsyncStateMachine(IdeaBlade.EntityModel.Compat.EntityManagerPartialSaveExtensions+d__2)] 
[Extension()] 
public static Task SaveChangesAsync( 
   EntityManager entityManager, 
   IEnumerable entities, 
   SaveOptions saveOptions 
)

Parameters

entityManager
The EntityManager holding entities to be persisted.
entities
List of IdeaBlade.EntityModel.IEntity objects to be persisted
saveOptions
Options controlling save processing

Return Value

A System.Threading.Tasks.Task which will indicate whether the asynchronous save concluded successfully.
Exceptions
ExceptionDescription
IdeaBlade.EntityModel.EntityManagerSaveExceptionThrown for save exceptions not handled by an EntityServerError handler
System.OperationCanceledExceptionThrown if the save was cancelled
Remarks
Persists a subset of additions, modifications and deletions within the EntityManager cache to the backend data source. Upon success, these entities will be in an Unchanged state.

If the save fails an IdeaBlade.EntityModel.EntityManagerSaveException will be thrown.

If the save is cancelled an System.OperationCanceledException will be thrown.

The asynchronous save task itself cannot be cancelled. However, you can cancel the save process on the client before the save starts in a EntityManager.Saving event handler. You can also cancel the save process on the server in an EntityServerySaveInterceptor prior to executing the save to the data source.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityManagerPartialSaveExtensions Class
EntityManagerPartialSaveExtensions Members

Send Feedback