0

I would like to just have a simple

[LogData]
public class MyFancyClass
{

  public void DoStuff(int x){}

}

I would like to get the class parameter name along with their values, so check if x was 5 ot r 5.

Can this be done with roslyn or do i need afterthought.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
Aflred
  • 4,435
  • 6
  • 30
  • 43
  • I'm not sure I fully understand the question. You might wish to clarify it a bit. – Jason Malinowski Dec 08 '16 at 23:48
  • Roslyn cannot do that. – SLaks Dec 08 '16 at 23:51
  • 1
    There's a NuGet package called `StackExchange.Precompilation` that allows pre-compilation syntax rewriting using the Roslyn API. You can use it to inject code into Roslyn's syntax tress before any IL is emitted. This can be applied to logging, method input checks, etc. I've started working on design-by-contract using this https://github.com/JamesFaix/Traction – JamesFaix Dec 12 '16 at 19:39

0 Answers0