title: C#: How to tell if an object is of a custom class or native type /.NET class?
body: <p>I have this class</p>
  
  <pre><code>public class MyViewModel {
    public MyClass Thing { get; set; }
    public int Id { get { return Thing.Id; } }
    public string Name { get { return Thing.Name; } }
  }
  </code></pre>
  
  <p>I noticed when I bind it to an ASP.NET GridView, it automatically omits <code>Thing</code>, and for a good reason (ie. because otherwise it will only show the meaningless "MyNamespace.MyClass" in all rows)<br></p>
  
  <p>I am trying to do a similar thing in this method.</p>
  
  <pre><code>public static string ConvertToCsv&lt;T&gt;(IEnumerable&lt;T&gt; items)
  {
    foreach (T item in items)
    {
      if(item is not a native/.NET class) // &lt;-- How do you do this?
        continue;
      else // If it is a string/int/bool/DateTime or something meaningful
      {
        ...
      }
    }
  }
  </code></pre>