System.Runtimer.CompilerService.Caller attributes methods and examples
1 static void CallerDemo() 2 { 3 SystemRuntimeCompilerServicesCallerDemo("Test System.Runtime.CompilerServices.Caller"); 4 } 5 6 static void SystemRuntimeCompilerServicesCallerDemo(string msg, 7 [System.Runtime.CompilerServices.CallerMemberName] string memberName="", 8 [System.Runtime.CompilerServices.CallerFilePath] string filePath="", 9 [System.Runtime.CompilerServices.CallerLineNumber] int lineNumber=0) 10 { 11 Console.WriteLine($"Msg={msg}"); 12 Console.WriteLine($"memberName={memberName}"); 13 Console.WriteLine($"filePath={filePath}"); 14 Console.WriteLine($"lineNumber={lineNumber}"); 15 }