I think you are asking something like:
Is there a way within AbstractClass<T>
that, where the type of T
is UserDTO
, I can determine the type of class X
where class X : AbstractClass<UserDTO>
If this is indeed your question, then the short answer is "yes". The path to achieving it is a little convoluted though.
First step, obtain a list of all the types in your system, using eg https://stackoverflow.com/a/4692463/7122.
Next step, for each type use the BaseType
property to get its parent type. If that type is AbstractClass
then examine its GenericTypeArguments
property to see if that is UserDTO
. If it is, that's your type.
More than one class may inherit from AbstractClass<UserDTO>
though, so you'd have to examine all types to check for that, rather than stopping at the first match.