Task.Run(Of TResult) Method (Func(Of TResult))
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Queues the specified work to run on the ThreadPool and returns a Task(TResult) handle for that work.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Shared Function Run(Of TResult) ( _ function As Func(Of TResult) _ ) As Task(Of TResult)
Type Parameters
- TResult
The result type of the task.
Parameters
- function
- Type: System.Func(Of TResult)
The work to execute asynchronously
Return Value
Type: System.Threading.Tasks.Task(Of TResult)A Task(TResult) that represents the work queued to execute in the ThreadPool.
| Exception | Condition |
|---|---|
| ArgumentNullException | The function parameter was null. |
Show: