Answers for "get method caller name c#"

C#
2

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].
Posted by: Guest on November-27-2020

C# Answers by Framework

Browse Popular Code Answers by Language