IdeaBlade.EntityModel.Compat Assembly > IdeaBlade.EntityModel.Compat Namespace > EntityManagerPartialSaveExtensions Class : TrySaveChangesAsync Method |
'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)
[Extension()] public static Task<SaveResult> TrySaveChangesAsync( EntityManager entityManager, IEnumerable entities, SaveOptions saveOptions )
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.
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