Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Lazy`1

Assembly: System.Runtime

Inheritance: object → Lazy`1

Provides support for lazy initialization.

Properties

public bool
IsValueCreated
Gets a value that indicates whether a value has been created for this <see cref="T:System.Lazy`1" /> instance.
public T
Value
Gets the lazily initialized value of the current <see cref="T:System.Lazy`1" /> instance.

Methods

public string
ToString​()
Returns The result of calling the <see cref="M:System.Object.ToString" /> method on the <see cref="P:System.Lazy`1.Value" /> property for this instance, if the value has been created (that is, if the <see cref="P:System.Lazy`1.IsValueCreated" /> property returns <see langword="true" /> ). Otherwise, a string indicating that the value has not been created.
Creates and returns a string representation of the <see cref="P:System.Lazy`1.Value" /> property for this instance.
public bool
Equals​(object obj)
Inherited from object
obj The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current object.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public int
GetHashCode​()
Inherited from object
Returns A hash code for the current object.
Serves as the default hash function.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .