title: Working Generic Lists of Base Types and Inherited Types
body: <p>Basically, I'm using an ORM (specifically LLBLGen) that creates entity objects for all my tables. All these entity types inherit from a base class (or really a set of them). I want to create an extension method that accepts a List of the base class and returns some string but I want to pass in inherited types without explicitly casting.</p>
  
  <p>For instance, I have a function like:</p>
  
  <pre><code>string GetString(List&lt;EntityBase2&gt; list); // also tried List&lt;IEntityCore&gt;, which the base class implements
  </code></pre>
  
  <p>And I want to pass it something like this:</p>
  
  <pre><code>List&lt;ProductEntity&gt; products = ... // populate it
  
  string v = GetString(products);
  </code></pre>
  
  <p>But I get compiler errors.</p>
  
  <p>How can I accomplish creating this helper method. I want to avoid casting if I can but if this is the best way then at least I could would have some confirmation on that.</p>