Extension method to process the result of an asynchronous save operation.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim source As IdeaBlade.EntityModel.EntitySaveOperation
Dim onSuccess As Action(Of SaveResult)
Dim onFail As Action(Of Exception)
Dim value As IdeaBlade.EntityModel.EntitySaveOperation
value = OperationFns.OnComplete(source, onSuccess, onFail) |
Parameters
- source
- The EntitySaveOperation returned from an asynchronous save.
- onSuccess
- A callback to be called if the asynchronous save was successful.
- onFail
- A callback to be called if the asynchronous save failed.
Return Value
Returns the EntitySaveOperation passed to the method's source parameter.
Example
C# | Copy Code |
---|
public OperationResult<SaveResult> Save(Action<SaveResult> onSuccess = null, Action<Exception> onFail = null)
{
EntitySaveOperation op = Manager.SaveChangesAsync();
return op.OnComplete(onSuccess, onFail).AsOperationResult();
} |
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also