Cocktail Help Reference
CreateAsync Method
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > Factory<T> Class : CreateAsync Method



onSuccess
Callback to be called if the entity creation was successful.
onFail
Callback to be called if the entity creation failed.

Glossary Item Box

Creates a new entity instance of type T.

Syntax

Visual Basic (Declaration) 
Public Overridable Function CreateAsync( _
   Optional ByVal onSuccess As Action(Of T), _
   Optional ByVal onFail As Action(Of Exception) _
) As OperationResult(Of T)
Visual Basic (Usage)Copy Code
Dim instance As Factory(Of T)
Dim onSuccess As Action(Of T)
Dim onFail As Action(Of Exception)
Dim value As OperationResult(Of T)
 
value = instance.CreateAsync(onSuccess, onFail)
C# 
public virtual OperationResult<T> CreateAsync( 
   Action<T> onSuccess,
   Action<Exception> onFail
)
C++/CLI 
public:
virtual OperationResult<T^>^ CreateAsync( 
   Action<T^>^ onSuccess,
   Action<Exception^>^ onFail
) 

Parameters

onSuccess
Callback to be called if the entity creation was successful.
onFail
Callback to be called if the entity creation failed.

Return Value

Asynchronous operation result.

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

© 2012 All Rights Reserved.