title: How to determine whether T is a value type or reference class in generic?
body: <p>I have a generic method behavior of which depends on T is reference type or value type. It looks so:</p>
  
  <pre><code>T SomeGenericMethod &lt;T&gt; (T obj)
  {
    if (T is class) //What condition I must write in the brackets?
     //to do one stuff
    else //if T is a value type like struct, int, enum and etc.
     //to do another stuff
  }
  </code></pre>
  
  <p>I can't duplicate this method like:</p>
  
  <pre><code>T SomeGenericMethod &lt;T&gt; (T obj) where T : class
  {
   //Do one stuff
  }
  
  T SomeGenericMethod &lt;T&gt; (T obj) where T : struct
  {
   //Do another stuff
  }
  </code></pre>
  
  <p>because their signatures are equal. Can anyone help me?</p>