Share via


TaskExtensionMethods.ToApm<TResult> Method

Definition

Adapts a Task to the APM pattern.

public static System.Threading.Tasks.Task<TResult> ToApm<TResult> (this System.Threading.Tasks.Task<TResult> task, AsyncCallback callback, object state);
static member ToApm : System.Threading.Tasks.Task<'Result> * AsyncCallback * obj -> System.Threading.Tasks.Task<'Result>
<Extension()>
Public Function ToApm(Of TResult) (task As Task(Of TResult), callback As AsyncCallback, state As Object) As Task(Of TResult)

Type Parameters

TResult

The result type of the task.

Parameters

task
Task<TResult>

The Task to adapt.

callback
AsyncCallback

The APM callback to inject.

state
Object

The APM state to inject.

Returns

Task<TResult>

A Task that has been adapted to use the APM pattern.

Remarks

Taken from http://blogs.msdn.com/b/pfxteam/archive/2011/06/27/10179452.aspx

Applies to