This question already has answers here: Can you use reflection to find the name of the currently executing method?