LazyInitializer.EnsureInitialized Method

.NET Framework 4.6 and 4.5

Initializes a target type if it hasn't already been initialized.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Static member Supported by Portable Class Library EnsureInitialized<T>(T) Initializes a target reference type with the type's default constructor if it hasn't already been initialized.
Public method Static member Supported by Portable Class Library EnsureInitialized<T>(T, Func<T>) Initializes a target reference type by using a specified function if it hasn't already been initialized.
Public method Static member Supported by Portable Class Library EnsureInitialized<T>(T, Boolean, Object) Initializes a target reference or value type with its default constructor if it hasn't already been initialized.
Public method Static member Supported by Portable Class Library EnsureInitialized<T>(T, Boolean, Object, Func<T>) Initializes a target reference or value type by using a specified function if it hasn't already been initialized.
Top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft