mercredi 3 juin 2015

How to get the subclass type by a generic argument on its parent class?

Example:

    public class MyClass : AbstractClass<UserDTO>
    {
        public MyClass()
        {
        }

        public string Property1 { get; set; }

        public string Property2 { get; set; }
    }

Is it even possible to get the type of MyClass just by examining the UserDTO object? If yes, how? TIA.





Aucun commentaire:

Enregistrer un commentaire