title: LINQ: From a list of type T, retrieve only objects of a certain subclass S
body: <p>Given a simple inheritance hierarchy:
  Person -> Student, Teacher, Staff</p>
  
  <p>Say I have a list of Persons, L.
  In that list are some Students, Teachers, and Staff.</p>
  
  <p>Using LINQ and C#, is there a way I could write a method that could retrieve only a particular type of person?</p>
  
  <p>I know I can do something like:</p>
  
  <pre><code>var peopleIWant = L.OfType&lt; Teacher &gt;();
  </code></pre>
  
  <p>But I want to be able to do something more dynamic.  I would like to write a method that will retrieve results for any type of Person I could think of, without having to write a method for every possible type.</p>