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
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: .NET
1 Comments:
it’s ok to show some appreciation and say ‘great post’
Asp .NET developer
Post a Comment
Subscribe to Post Comments [Atom]
<< Home