| AsyncActivatorCreateAsyncT, TArg Method (TArg, CancellationToken) |
Asynchronously creates and initializes an instance of the specified type.
Namespace:
Ditto.AsyncInit
Assembly:
Ditto.AsyncInit (in Ditto.AsyncInit.dll) Version: 1.5.0.2281
Syntax public static Task<T> CreateAsync<T, TArg>(
TArg arg,
CancellationToken cancellationToken
)
where T : Object, ICancelableAsyncInit<TArg>
Public Shared Function CreateAsync(Of T As {Object, ICancelableAsyncInit(Of TArg)}, TArg) (
arg As TArg,
cancellationToken As CancellationToken
) As Task(Of T)
public:
generic<typename T, typename TArg>
where T : Object, ICancelableAsyncInit<TArg>
static Task<T>^ CreateAsync(
TArg arg,
CancellationToken cancellationToken
)
static member CreateAsync :
arg : 'TArg *
cancellationToken : CancellationToken -> Task<'T> when 'T : Object and ICancelableAsyncInit<'TArg>
Parameters
- arg
- Type: TArg
The initialization argument. - cancellationToken
- Type: System.ThreadingCancellationToken
Cancellation token.
Type Parameters
- T
- The type of object to create (must implement ICancelableAsyncInitTArg).
- TArg
- The type of the initialization argument.
Return Value
Type:
TaskTA
Task capturing the initialization.
See Also