MetalamaConceptual documentationCreating aspectsWriting T# templates
Open sandboxFocusImprove this doc

Writing T# templates

Code templates in Metalama are written in a dialect of C#, known as T#. The syntax of T# is fully compatible with C#, but T# is compiled differently.

This chapter includes the following articles:

Article Description
T# templates: Overview This article provides an introduction to T#, the template language for Metalama.
Writing compile-time code This article outlines the subset of the C# language that can be used as compile-time code and illustrates how to create templates with rich compile-time logic.
Generating run-time code This article details different techniques for generating run-time code dynamically.
Generating System.Reflection objects This article clarifies how to generate run-time System.Reflection objects for compile-time Metalama.Framework.Code objects from a template.
Template parameters and type parameters This article describes how to pass parameters, including generic parameters, from the BuildAspect method to the template.
Calling auxiliary templates This article explains how templates can invoke other templates, referred to as auxiliary templates.
Debugging aspects This article provides guidance on how to debug templates.