FromResult(TResult) Method

Task.FromResult(Of TResult) Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Creates a Task(Of TResult) that's completed successfully with the specified result.

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

'Declaration
Public Shared Function FromResult(Of TResult) ( _
	result As TResult _
) As Task(Of TResult)

Type Parameters

TResult

The type of the result returned by the task.

Parameters

result
Type: TResult
The result to store into the completed task.

Return Value

Type: System.Threading.Tasks.Task(Of TResult)
The successfully completed task.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft