How to modify code before compilation?
49
Using Roslyn, I would like to modify my C# code before the actual compilation. For now, I will just need something like:
[MyAnotatedMethod]
public void MyMethod()
{
// method-body
}
And based on the annotation, I would like to inject some code at the beginning of the method, and at the end of the method.
I'm aware of PostSharp, but that's not what I would like.
Is this possible to do with Roslyn? And if yes, could you give me an example?