title: Implementation of IEnumerable<T> works for foreach but not LINQ
body: <p>I currently use the following base collection. </p>
  
  <pre><code>  abstract class BaseCollection : Collection&lt;BaseRecord&gt;
    {       
    }
  </code></pre>
  
  <p>I would like to replace it with the generic collection below. This however is not a trivial task due to the amount of derived classes that currently implement BaseCollection. </p>
  
  <pre><code>  abstract class BaseCollection&lt;TRecord&gt; : Collection&lt;TRecord&gt; where TRecord : BaseRecord,new()
    {
  
    }
  </code></pre>
  
  <p>Instead of a massive overhaul I'd like to slowly introduce this new collection. </p>
  
  <pre><code>   abstract class BaseCollection&lt;TRecord&gt; : BaseCollection,IEnumerable&lt;TRecord&gt; where TRecord : BaseRecord,new()
     {
        public new IEnumerator&lt;TRecord&gt; GetEnumerator()
        {
           return Items.Cast&lt;TRecord&gt;().GetEnumerator(); 
        }
     }
  </code></pre>
  
  <p>While I can enumerate over the collection using a foreach, the LINQ statement below does not compile. Is this possible? I realize this is a bit of hack but I'm not sure how else to get this done. </p>
  
  <pre><code>   class Program
     {
        static void Main(string[] args)
        {
           DerivedCollection derivedCollection = new DerivedCollection
           {
              new DerivedRecord(),
              new DerivedRecord()
           };
           foreach (var record in derivedCollection)
           {
              record.DerivedProperty = "";
           }
           var records = derivedCollection.Where(d =&gt; d.DerivedProperty == "");
        }
     }
  </code></pre>
  
  <p>Here are the two records used above. Thanks. </p>
  
  <pre><code>   class DerivedRecord : BaseRecord
     {
        public string DerivedProperty { get; set; }
     }
  
     abstract class BaseRecord
     {
        public string BaseProperty { get; set; }
     }
  </code></pre>
  
  <p>Here is the derived collection.   </p>
  
  <pre><code>   class DerivedCollection : BaseCollection&lt;DerivedRecord&gt;
     {
  
     }
  </code></pre>