I need to get all available classes in a giving namespace.
Here is what I have done
In my Index
method in XyzController.cs
I added this line.
var classesList = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.Namespace == "PATH.TO.HAMESPACE").ToList()
Unfortunately, that gave me no records/classes.
However, when I created a new class in the the same namespace i.e. PATH.TO.HAMESPACE
. with the same code. Then called this class from the controller, the code returns the correct classes list.
How can I run this code from the controller to get all available classes with in PATH.TO.HAMESPACE
?