title: How can I check the type of an object against a list of types?
body: <p>Given a collection </p>
  
  <pre><code>IEnumerable&lt;Type&gt; supportedTypes
  </code></pre>
  
  <p>What's the best way to check whether a given object is one of those types (or a derived type)?</p>
  
  <p>My first instinct was to do something like:</p>
  
  <pre><code>// object target is a parameter passed to the method in which I'm doing this.
  if (supportedTypes.Count( supportedType =&gt; target is supportedType ) &gt; 0)
  {
      // Yay my object is of a supported type!!!
  }
  </code></pre>
  
  <p>..but that doesn't seem to be working.  Can I not use the "is" keyword in a lambda expression like this?</p>