C# accessing a static property of type T in a generic class

前端 未结 7 1515
后悔当初
后悔当初 2020-12-16 09:30

I am trying to accomplish the following scenario that the generic TestClassWrapper will be able to access static properties of classes it is made of (they will all derive fr

7条回答
  •  太阳男子
    2020-12-16 09:42

    In this situation you assume that T is a subclass of TestClass. Subclasses of TestClass will not have the static int x.

提交回复
热议问题