Run Method (Func(Task))

Task.Run Method (Func<Task>)

[ 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 proxy for the Task returned by function.

Namespace:  System.Threading.Tasks
Assembly:  mscorlib (in mscorlib.dll)

public static Task Run(
	Func<Task> function
)

Parameters

function
Type: System.Func<Task>
The work to execute asynchronously

Return Value

Type: System.Threading.Tasks.Task
A Task that represents a proxy for the Task returned by function.

ExceptionCondition
ArgumentNullException

The function parameter was null.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft