title: C# Type checking for generics
body: <p>Suppose I have a class </p>
  
  <pre><code>public class Entity&lt;T&gt; { ... // class definition ... }
  </code></pre>
  
  <p>And say I have bit of code like:</p>
  
  <pre><code>var a = new Entity&lt;string&gt;();
  var b = new Entity&lt;int&gt;();
  var c = new Entity&lt;bool&gt;();
  var d = new int;
  var e = new List&lt;string&gt;();
  </code></pre>
  
  <p>How do I test that an object is of type "Entity" regardless of the type of T? Such that:</p>
  
  <pre><code>a is Entity    // true
  b is Entity    // true
  c is Entity    // true
  d is Entity    // false
  e is Entity    // false
  </code></pre>