c# get function caller 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].