Transforming code
In Creating simple aspects, you have learned how to build simple aspects composed of a single transformation (or advice). In this section, you will learn more advanced scenarios, and you will also see how to create aspects composed of multiple pieces of advice. But before we start, we must introduce a few more concepts.
Article | Description |
---|---|
Transforming code: concepts | This article describes important concepts. We suggest reading this article first, then jumping to the article that covers the advice you need. |
Overriding methods | This article shows advanced techniques to override methods. It is the continuation of Getting started: overriding a method. |
Overriding fields or properties | This article shows advanced techniques to override fields and properties. It is the continuation of Getting started: overriding fields and properties. |
Overriding events | This article shows how to override events. |
Validating parameter, field, and property values with contracts | This article shows advanced techniques to validate the value 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 explains how to make an existing type implement a new interface using aspects. |
Adding initializers | This article explains how to add initialization logic to constructors. |
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. |