How to extend a class with an aspect

I want to generate code like to following:

The second line is the problem; how do I Extend an existing class?

If Cirrus doesn’t have explicit APIs for this (I’m not surprised) then, for now you’ll have to do it the manual way — e.g. the same way you’d declare this in classic VB/NET:

Use Cirrus to create a static class, add the Extension attribute to it, and amend each method with “self” as a first parameter.

I’ll log a feature request.


Logged as bugs://E25865.

bugs://E25865 was closed as fixed.


1 Like