Represents an invocation of a template method that can be kept across compilations. It is the durable counterpart of TemplateInvocation.
Namespace: Metalama.Framework.Aspects
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
[Durable]
public sealed class DurableTemplateInvocationRemarks
Use this type where an API keeps a template invocation after the compilation in which it was created, for instance a registration that is evaluated again in each new compilation. Use TemplateInvocation everywhere else.
The values of Arguments must be durable. A declaration or a type must be passed as a durable reference (see ToDurableRef<T>(T)), and an expression must be passed as a durable expression (see ToDurable(IExpression)). Literals, enumeration values and Type values are durable. A durable reference or a durable expression is resolved in the compilation in which the template is expanded, so that the template receives the declaration, the type or the IExpression of that compilation.
Constructors
| Name | Description |
|---|---|
| DurableTemplateInvocation(string, ITemplateProvider, object?) | Initializes a new instance of the DurableTemplateInvocation class for a template of a given ITemplateProvider. |
| DurableTemplateInvocation(string, object?) | Initializes a new instance of the DurableTemplateInvocation class for a template of the current template provider. |
Properties
| Name | Description |
|---|---|
| Arguments | Gets the object whose properties map to parameters or type parameters of the template, or |
| TemplateName | Gets the name of the called template method. |
| TemplateProvider | Gets the TemplateProvider where the template is found, or |
Methods
| Name | Description |
|---|---|
| FromType<T>(string, object?) | Creates a DurableTemplateInvocation for a static template declared by a given type. |