get calling method name method class c# code example
Example: c# get calling method name
//using System.Runtime.CompilerServices;
public void SendError(string Message, [CallerMemberName] string callerName = "")
{
Console.WriteLine(callerName + "called me.");
}
// You can also get the [CallerFilePath] and [CallerLineNumber].