System.Lazy<T>.ToString Method

Creates and returns a string representation of the Lazy`1.Value property for this instance.

Syntax

public override string ToString ()

Returns

The result of calling the object.ToString method on the Lazy`1.Value property for this instance, if the value has been created (that is, if the Lazy`1.IsValueCreated property returns true). Otherwise, a string indicating that the value has not been created.

Remarks

Calling this method does not cause initialization.

The Lazy`1.Value property can be null after lazy initialization if the factory method that was specified for the valueFactory parameter of the Lazy`1.#ctor(Func<`0>), Lazy`1.#ctor(Func<`0>,System.Threading.LazyThreadSafetyMode), or Lazy`1.#ctor(Func<`0>,System.Boolean) constructor returns null.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0