Tuesday, February 26, 2013

New Modifier: 6 Simple New(er) C#/.Net features you may have missed

New Modifier: 6 Simple New(er) C#/.Net features you may have missed:

'via Blog this'


Caller Information Attributes


Calling method arguments are a very useful feature implemented in the C# 5.0 compiler.  Now you can get information about how your method was called.  This is a huge improvement on having to look into the stack trace in order to achieve diagnostic level logging.  Here's an example of how it would work in a method that takes a string parameter.













No comments: