MetalamaConceptual documentationCreating aspectsAdvising code
Open sandboxFocusImprove this doc

Transforming code

In Creating simple aspects, you learned how to build simple aspects composed of a single transformation (or advice). This section introduces more advanced scenarios and explains how to create aspects composed of multiple pieces of advice. However, before we delve into these topics, we need to familiarize you with a few additional concepts.

Article Description
Transforming code: concepts This article describes essential concepts. We recommend reading this article first before proceeding to the article that covers the advice you need.
Overriding methods This article presents advanced techniques for overriding methods. It is the continuation of Getting started: overriding a method.
Overriding fields or properties This article provides advanced techniques for overriding fields and properties. It is the continuation of Getting started: overriding fields and properties.
Overriding events This article demonstrates how to override events.
Validating parameter, field, and property values with contracts This article presents advanced techniques for validating the values of fields, properties, or parameters using contracts. It is the continuation of Getting started: contracts.
Introducing members This article explains how to add new members to an existing type using aspects.
Implementing interfaces This article details how to make an existing type implement a new interface using aspects.
Adding initializers This article describes how to add initialization logic to constructors.
Adding custom attributes This article elucidates how to add or remove custom attributes.
Introducing constructor parameters This article explains how to append new parameters to constructors and pull their value from constructors of derived classes.
Sharing state with advice This article discusses how the BuildAspect method can pass parameters or state to the templates.