Open sandboxFocus

Class CompiledTemplateAttribute

Internal attribute added by Metalama during compilation to preserve the original characteristics of templates.

Inheritance
CompiledTemplateAttribute
Namespace: Metalama.Framework.Aspects
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
[AttributeUsage(AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Event)]
public sealed class CompiledTemplateAttribute : Attribute
Remarks

This attribute is internal to the Metalama infrastructure and should not be used in user code. When Metalama compiles T# templates into standard C# code that generates run-time code using the Roslyn API, some characteristics of the template methods (such as accessibility, async state, and iterator state) may be modified during the compilation process. This attribute stores the original values so they can be referenced during template expansion.

As part of the T# compilation process, Metalama separates compile-time code from run-time code and embeds the compile-time code (including compiled templates) as a managed resource in the run-time assembly. This attribute ensures that template metadata remains accurate throughout this transformation.

Constructors

Name Description
CompiledTemplateAttribute()

Properties

Name Description
Accessibility
IsAsync
IsIteratorMethod

Extension Methods

See Also