I have a class Validator<T>
and a multitude of other classes that inherit from it like: TagValidator : Validator<Tag>
.
Let's say I want to make a single ModelValidator
class that stores all the classes that inherit from Validator<T>
and runs a specific one when I do ModelValidator.Validate<T>(T model)
Is there a way to store classes with a generic type in a single array or perhaps a dictionary?