Getting parent class' name using Reflection

前端 未结 8 878
后悔当初
后悔当初 2020-12-03 16:30

How can I get the name of the parent class of some class using Reflection?

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 17:13

    Currently in .NET Core, BaseType is not available, you can retrieve it by:

    typeof(T).GetTypeInfo().BaseType
    

提交回复
热议问题