Open sandboxFocusImprove this doc

Metalama API

The Metalama API provides comprehensive access to code transformation, analysis, and introspection capabilities for .NET applications.

Section Description
Code model API Defines the compile-time representation of the code model.
Aspect API Create aspects and fabrics that transform source code, report diagnostics, and validate declarations.
Extensions API Extensions based on the Metalama.Framework abstractions, including architecture validation, code fixes, and dependency injection.
Patterns API Implementation of common design patterns, including caching, memoization, code contracts, and observability (INotifyPropertyChanged).
Flashtrace API Logging front-end used by Metalama.Patterns.Caching.
Introspection API Query and analyze your code using the Metalama code model from any application, including LINQPad.
Advanced extensibility API (SDK) Extend Metalama using the Roslyn API. Use cases include analyzing method implementations, implementing custom aspect weavers, and defining custom metrics.
Testing API Testing frameworks for unit testing compile-time logic and snapshot-based aspect testing.
PostSharp API annotated for migration to Metalama Maps the PostSharp API to its Metalama equivalent.