Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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].
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #calling #method
ADD COMMENT
Topic
Name
2+1 =