<PackageReference Include="Nito.AsyncEx.Tasks" Version="5.0.0-pre-04" />

Nito.AsyncEx.Interop.ApmAsyncFactory

public static class ApmAsyncFactory
Creation methods for tasks wrapping the Asynchronous Programming Model (APM), and APM wrapper methods around tasks.
public static IAsyncResult ToBegin(Task task, AsyncCallback callback, object state)

Wraps a Task into the Begin method of an APM pattern.

public static IAsyncResult ToBegin<TResult>(Task<TResult> task, AsyncCallback callback, object state)

Wraps a Task<T> into the Begin method of an APM pattern.

public static void ToEnd(IAsyncResult asyncResult)

Wraps a Task into the End method of an APM pattern.

public static TResult ToEnd<TResult>(IAsyncResult asyncResult)

Wraps a Task<T> into the End method of an APM pattern.