Getting names of local variables (and parameters) at run-time through lambda expressions

后端 未结 3 1580
情话喂你
情话喂你 2020-12-03 10:40

I’m interested in retrieving the names of local variables (and parameters) at run-time in a refactor-safe manner. I have the following extension method:

publ         


        
3条回答
  •  悲&欢浪女
    2020-12-03 11:19

    AFAIK, it's an implementation detail.

    However, I think you can bet it won't actually change.

    I just tested in VS2012 RC and it works as expected - so you're safe for a couple of years at least.

提交回复
热议问题