Current class name:
this.GetType().Name;
Current method name:
using System.Reflection;
// ...
MethodBase.GetCurrentMethod().Name;
Since you’re using this for logging purposes, you may also be interested in getting the current stack trace.
Current class name:
this.GetType().Name;
Current method name:
using System.Reflection;
// ...
MethodBase.GetCurrentMethod().Name;
Since you’re using this for logging purposes, you may also be interested in getting the current stack trace.