title: How to find types that are direct descendants of a base class?
body: <p>I need to get all types of an assembly that inherits some base class but only the first descendants. For instance if I have:</p>
  
  <pre><code>class Base
  {
  
  }
  
  class FirstClass : Base
  {
  
  }
  
  class SecondClass : FirstClass
  {
  
  }
  </code></pre>
  
  <p>Now</p>
  
  <pre><code>var directOnes = assembly.GetTypes().Where(t =&gt; t.IsSubclassOf(typeof(Base)));
  </code></pre>
  
  <p>should return only <code>FirstClass</code> and not <code>SecondClass</code>. Is there a way to find out?</p>