0

In C#, is there a way to show all the methods belong to a class?

Probably there is no inbuilt method to do this. But there should be a way to achieve this.

1 Answers1

0

this will show you all the static and instanc methods for both public and private ones for class Program as an example, change the name of the class to the desired one

foreach (var method in typeof(Program).GetMethods(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance))
{
                Console.WriteLine(method.Name);
}
Abdulkarim Kanaan
  • 1,703
  • 4
  • 20
  • 32