AsyncLazyInitializer.InitializeAsync(CancellationToken) Method

Definition

Executes the action given in the constructor if it has not yet been executed, or waits for it to complete if in progress from a prior call.

public System.Threading.Tasks.Task InitializeAsync (System.Threading.CancellationToken cancellationToken = default);
member this.InitializeAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function InitializeAsync (Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

cancellationToken
CancellationToken

Returns

A task that tracks completion of the action.

Exceptions

Any exception thrown by the action is rethrown here.

Applies to