All functions in C # must exist inside the class, so the first example does not apply in the context of global functions.
In the case of a class, you will know at compile time if it exists:
MyClass x = new MyClass();
will return at compile time if MyClass not defined.
If you want to get a list of methods that belong to MyClass, you can use Reflection :
source share