//1.
var methodInfo = MethodBase.GetCurrentMethod();
Console.WriteLine(methodInfo.Name);
//2.
var method = new StackTrace().GetFrame(0).GetMethod();
Console.WriteLine(method.Name);
https://blog.csdn.net/langqunlideyang/article/details/50276527