I have multiple classes, all residing in a distinct namespace. All classes derive from the same base class, all have the same function, accepting the same parameters. I would like to be able to iterate through the classes, calling said function.
I know I can get a list of the classes using the following:
var validationClasses = Assembly.GetExecutingAssembly().GetTypes()
.Where(t => t.Namespace == "Panther.Business.Shipping.Validate")
.ToList();
And, of course, I can iterate through each class in validationClasses.
But I can’t figure out how to instantiate an instance of each class, and call that function.
Any direction greatly appreciated.