ValueTask<TResult>.Result ValueTask<TResult>.Result ValueTask<TResult>.Result ValueTask<TResult>.Result Property

Definition

Gets the result.

public:
 property TResult Result { TResult get(); };
public TResult Result { get; }
member this.Result : 'Result
Public ReadOnly Property Result As TResult

Property Value

TResult TResult TResult TResult

The result.

Remarks

If this ValueTask<TResult> wraps a successful result, this property returns it directly.

If it wraps a Task<TResult>, the behavior of Result is similar to the behavior of accessing Result on the wrapped task: if the task hasn't completed, accessing the property blocks the calling thread until it completes; if the task has completed successfully, the property returns the result; if the task has faulted or was cancellecd, accessing the property throws an exception. The thrown exception is not wrapped in an AggregateException, which is different from the behavior of Result in the same situation.

Applies to