Assmbly.GetTpes() gets the types in the assembly but if I also wants nested class (OrderLine) how do I do that? I only know the name of the assembly, not the class names so GetType(Order+OrderLine) will not work.
public class Order
{
public class OrderLine
{
}
}
I don’t know if
assembly.GetTypes()is supposed to include nested classes. Assuming it doesn’t, a method like the following could iterate over all the assembly’s types.Edit:
MSDN has the following to say about
Assembly.GetTypesSo really my above answer shouldn’t be necessary. You should find both
OrderandOrder+OrderLinereturned as types byAssembly.GetTypes.