AsyncLazy<T>.GetValue Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetValue() |
Gets the lazily computed value. |
GetValue(CancellationToken) |
Gets the lazily computed value. |
GetValue()
Gets the lazily computed value.
public:
T GetValue();
public T GetValue ();
member this.GetValue : unit -> 'T
Public Function GetValue () As T
Returns
The lazily constructed value.
Exceptions
Thrown when the value factory calls GetValueAsync() on this instance.
Applies to
GetValue(CancellationToken)
Gets the lazily computed value.
public:
T GetValue(System::Threading::CancellationToken cancellationToken);
public T GetValue (System.Threading.CancellationToken cancellationToken);
member this.GetValue : System.Threading.CancellationToken -> 'T
Public Function GetValue (cancellationToken As CancellationToken) As T
Parameters
- cancellationToken
- CancellationToken
A token whose cancellation indicates that the caller no longer is interested in the result. Note that this will not cancel the value factory (since other callers may exist). But when this token is canceled, the caller will experience an OperationCanceledException immediately and a dis-joining of any JoinableTask that may have occurred as a result of this call.
Returns
The lazily constructed value.
Exceptions
Thrown when the value factory calls GetValueAsync() on this instance.
Thrown when cancellationToken
is canceled before the value is computed.