Partager via


ExtensionMethods.GetValueIfCreated<T>(Lazy<T>) Method

Definition

Returns the Value of a Lazy<T> if it has been created, or null if it hasn't.

public:
generic <typename T>
 where T : class[System::Runtime::CompilerServices::Extension]
 static T GetValueIfCreated(Lazy<T> ^ lazy);
public static T GetValueIfCreated<T> (this Lazy<T> lazy) where T : class;
static member GetValueIfCreated : Lazy<'T (requires 'T : null)> -> 'T (requires 'T : null)
<Extension()>
Public Function GetValueIfCreated(Of T As Class) (lazy As Lazy(Of T)) As T

Type Parameters

T

The type controlled by the lazy initializer

Parameters

lazy
Lazy<T>

The lazy initializer

Returns

T

Applies to