DevForce Help Reference
TrySaveChangesAsync 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
 
<ExtensionAttribute()>
Public Shared Function TrySaveChangesAsync( _
   ByVal entityManager As EntityManager, _
   ByVal entities As IEnumerable, _
   Optional ByVal saveOptions As SaveOptions _
) As Task(Of SaveResult)
'Usage
 
Dim entityManager As EntityManager
Dim entities As IEnumerable
Dim saveOptions As SaveOptions
Dim value As Task(Of SaveResult)
 
value = EntityManagerPartialSaveExtensions.TrySaveChangesAsync(entityManager, entities, 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 IdeaBlade.EntityModel.SaveResult that contains a boolean indicating the result of the save as well as any error encountered during the save.
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.

A IdeaBlade.EntityModel.SaveResult is always returned. The SaveResult will indicate if the save was successful, if processing was cancelled, or it an error occurred.

The async 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 EntityQuerySaveInterceptor 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