You can check the stack trace
using System.Diagnostics; // get call stack StackTrace stackTrace = new StackTrace(); // get calling method name Console.WriteLine(stackTrace.GetFrame(0).GetMethod().Name);
But be careful, if the method is built-in, you get the name of the parent method.
Albin Sunnanbo Apr 12 2018-12-12T00: 00Z
source share