John Baird
Coatesville, Pennsylvania, United States
General information
Category:
Coding, syntax and commands
Environment versions
Network:
Windows 2003 Server
Likes (1)
Naomi Nosonovsky
>Hi everybody,
>
>I have a method which I call from another method. I am wondering whether is a way to get that calling method's name in the current method?
>
>I want to use this for logging. I guess I can pass the method's name as alternative.
>
>Thanks in advance.
>
>In other words, the same class
>
>MethodA
> if (MethodB)
> ...
>
>
>In methodB I want to get the 'MethodA' string.
Look at the CallerMemberName capability of c#
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only