Take a look at the System.Diagnostics.StackTrace class
System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace();
string methodName = st.GetFrame(0).GetMethod().Name;
Keep in mind that there is a performance cost. You want to be careful using this in performance-sensitive code.
source
share