System.Threading.Tasks.Task< T >

Represents an asynchronous task that has a result.

Summary

Details
Template Parameters
T
The type of the task's result.

Inheritance

Inherits from: System.Threading.Tasks.Task

Properties

Result
T
Gets the result of the task.

Public functions

ContinueWith(Action< Task< T >> continuation)
Registers a continuation for the task that will run when the task is complete.
ContinueWith< TResult >(Func< Task< T >, TResult > continuation)
Task< TResult >
Registers a continuation for the task that will run when the task is complete.

Properties

Result

T Result

Gets the result of the task.

If the task is not complete, this property blocks until the task is complete. If the task has an Exception or was cancelled, this property will rethrow the exception.

Public functions

ContinueWith

Task ContinueWith(
  Action< Task< T >> continuation
)

Registers a continuation for the task that will run when the task is complete.

Details
Parameters
continuation
The continuation to run after the task completes. The function takes the completed task as an argument.
Returns
A new Task that is complete after both the task and the continuation are complete.

ContinueWith< TResult >

Task< TResult > ContinueWith< TResult >(
  Func< Task< T >, TResult > continuation
)

Registers a continuation for the task that will run when the task is complete.

Details
Template Parameters
TResult
The type returned by the continuation.
Parameters
continuation
The continuation to run after the task completes. The function takes the completed task as an argument and can return a value.
Returns
A new Task that returns the value returned by the continuation after both the task and the continuation are complete.

Send feedback about...

Need help? Visit our support page.