SetResult Method

Task Parallel System.Threading

Transitions the underlying Task<(Of <(TResult>)>) into the RanToCompletion state.

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

Syntax

Visual Basic (Declaration)
Public Sub SetResult ( _
	result As TResult _
)
C#
public void SetResult(
	TResult result
)

Parameters

result
Type: TResult
The result value to bind to this Task<(Of <(TResult>)>).

Exceptions

ExceptionCondition
System..::.InvalidOperationException The underlying Task<(Of <(TResult>)>) is already in one of the three final states: RanToCompletion, Faulted, or Canceled.
System..::.ObjectDisposedExceptionThe Task was disposed.

See Also