TaskExtensionMethods.ToApm<TResult> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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