Partager via


JoinableTaskFactory.Run<T> Method (Func<Task<T>>)

Runs the specified asynchronous method.

Namespace:  Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

Syntax

'Declaration
Public Function Run(Of T) ( _
    asyncMethod As Func(Of Task(Of T)) _
) As T
public T Run<T>(
    Func<Task<T>> asyncMethod
)
public:
generic<typename T>
T Run(
    Func<Task<T>^>^ asyncMethod
)
member Run : 
        asyncMethod:Func<Task<'T>> -> 'T 
JScript does not support generic types or methods.

Type Parameters

  • T
    The type of value returned by the asynchronous method.

Parameters

  • asyncMethod
    Type: System.Func<Task<T>>

    The asynchronous method to execute.

Return Value

Type: T
The value returned by the asynchronous method.

.NET Framework Security

See Also

Reference

JoinableTaskFactory Class

Run Overload

Microsoft.VisualStudio.Threading Namespace