title: Linq with custom base collection
body: <p>I often find linq being problematic when working with custom collection object.
  They are often defened as</p>
  
  <p>The base collection</p>
  
  <pre><code>abstract class BaseCollection&lt;T&gt; : List&lt;T&gt; { ... }
  </code></pre>
  
  <p>the collections is defined as</p>
  
  <pre><code>class PruductCollection : BaseCollection&lt;Product&gt; { ... }
  </code></pre>
  
  <p>Is there a better way to add results from a linq expession to this collection than
  addrange or concat?</p>
  
  <pre><code>var products = from p in HugeProductCollection
                 where p.Vendor = currentVendor
                 select p;
  PruductCollection objVendorProducts = new PruductCollection();
  objVendorProducts.AddRange(products);
  </code></pre>
  
  <p>It would be nice if the object returned form the linq query was of my custom collection type. As you seem to need to enumerate the collection two times to do this.</p>
  
  <p><strong>EDIT</strong> :
  After reading the answers i think the best solution is to implementa a ToProduct() extention. 
  Wonder if the covariance/contravariance in c#4.0 will help solve these kinds of problems.</p>