title: How can I access a static property of type T in a generic class?
body: <p>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 from TestClass). Something like:</p>
  <pre><code>public class TestClass
  {
      public static int x = 5;
  }
  
  public class TestClassWrapper&lt;T&gt; where T : TestClass
  {
      public int test()
      {
          return T.x;
      }
  }
  </code></pre>
  <p>Gives the error:</p>
  <blockquote>
  <p>'T' is a 'type parameter', which is not valid in the given context.</p>
  </blockquote>
  <p>Any suggestions?</p>