Skip to content

M_CodeJam_Lazy_Create__1_4

Andrew Koryavchenko edited this page Jun 17, 2018 · 5 revisions

Lazy.Create(T) Method (Func(T), LazyThreadSafetyMode)

Initializes a new instance of the Lazy(T) class. When lazy initialization occurs, the default constructor of the target type is used.

Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public static Lazy<T> Create<T>(
	Func<T> valueFactory,
	LazyThreadSafetyMode mode
)

VB

Public Shared Function Create(Of T) ( 
	valueFactory As Func(Of T),
	mode As LazyThreadSafetyMode
) As Lazy(Of T)

F#

static member Create : 
        valueFactory : Func<'T> * 
        mode : LazyThreadSafetyMode -> Lazy<'T> 

Parameters

 

valueFactory
Type: System.Func(T)
The delegate that is invoked to produce the lazily initialized value when it is needed.
mode
Type: System.Threading.LazyThreadSafetyMode
One of the enumeration values that specifies the thread safety mode.

Type Parameters

 

T
The type of object that is being lazily initialized.

Return Value

Type: Lazy(T)
New Lazy(T) instance.

See Also

Reference

Lazy Class
Create Overload
CodeJam Namespace

Clone this wiki locally