How to identify the <T> type for Int,String,Generic Type or class : <p>Here is my code, 
which i am trying but fail. T is take any type of DataType, Class or Generic class. Based on Type Assign value in type.</p>

<pre><code>   public T ToObject&lt;T&gt;()
        {
            //T is : int,int?,string,float,decimal 
            if (typeof(T).IsValueType)
            {
                //TO DO : Return Value Type
            }    
            //T is Generic List&lt;User&gt; 
            if (typeof(T).IsGenericType)
            {
                //TO DO : Return List of Object
            }
            else
            {
                //T is User 
                //TO DO : Return Object
            }                
            return default(T);
        }
</code></pre>
