Open sandboxFocus

Interface IPromise<T>

Encapsulates value that must be defined later. Promises can used to pass introduced declarations to templates as arguments when these declarations have not been introduced yet, resolving a chicken-or-egg situation. When objects of type IPromise are passed to a template, the template will automatically receive its resolved Value instead of the IPromise object. The Promise<T> class implements this interface.

Namespace: Metalama.Framework.Utilities
Assembly: Metalama.Framework.dll
Syntax
public interface IPromise<out T> : IPromise
Type Parameters
Name Description
T

Properties

Name Description
Value

Gets the value. Throws InvalidOperationException if IsResolved is false.

Extension Methods