Monday, January 30, 2012

Getting Class Name and Method name using reflection

To get the current method and class name in which the code is executing, we can use reflection.

Method Details

System.Reflection.MethodBase.GetCurrentMethod().Name, 

Class Details
System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name

Handy to log the errors .. 

No comments:

Post a Comment