Tuesday, July 28, 2009

How to get Property.Name

In some scenarios you might be interested to know current method / property name.
Eg I called some common code from each property and wanted to know calling property name.
Obviously C# doesnt have something like CurrentProperty.Name

You can archive that analysing Stack trace:



You might want to change index no in GetFrame to get interested information

Labels:

1 Comments:

Blogger Unknown said...


it’s ok to show some appreciation and say ‘great post’
Asp .NET developer

June 7, 2016 at 12:26 PM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home