ToDurable()
Returns a reference to the same declaration that stores only a string identifier, and therefore does not keep the compilation in memory. Returns the current instance when it is already durable.
Declaration
IDurableRef ToDurable()Returns
| Type | Description |
|---|---|
| IDurableRef |
Remarks
Call this method before storing a reference in an object that outlives the current pipeline run, such as a field of a fabric or of an inheritable aspect. Resolving the result costs an identifier lookup, which is why references are not durable by default. When the declaration itself is at hand, call ToDurableRef<T>(T) instead, which does not create the intermediate non-durable reference.
A reference that cannot be represented by an identifier, such as a reference to an attribute, does not support this method.
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | The reference cannot be made durable. |