title: Convert system.Type to user defined type
body: <p>I am trying to get all the classes inheriting a base class. </p>
  
  <pre><code>  public void GetClassNames()
    {
  
       List&lt;BaseClass&gt; data = AppDomain.CurrentDomain.GetAssemblies()
                             .SelectMany(assembly =&gt; assembly.GetTypes())
                             .Where(type =&gt; type != null &amp;&amp; 
                             type.IsSubclassOf(typeof(BaseClass))).ToList();
    }
  </code></pre>
  
  <p>However, the above code throws an error.<br>
  "Cannot implicitly convert type <code>System.Collections.Generic.List&lt;System.Type&gt;' to</code>System.Collections.Generic.List"</p>
  
  <p>How do I cast it to the type BaseClass please?</p>