title: Best method to use IDataReader as IEnumerable<T>?
body: <p>I need to use <em>Linq</em> on any <em>IDataReader</em> implementations like this</p>
  
  <pre><code>var c = sqlDataReader.AsEnumerable().Count();
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>public abstract class Test
  {
      public abstract SqlDataReader GetSqlDataReader();
  
      public void Foo()
      {
          SqlDataReader sqlDataReader = GetSqlDataReader();
          IEnumerable&lt;SqlDataReader&gt; sqlEnumerable = sqlDataReader.AsEnumerable();
          var c = sqlEnumerable.Count();
          var s = sqlEnumerable.Sum();
          SqlDataReader first = sqlEnumerable.First();
          var t = first.GetSqlXml(10);
      }
  }
  </code></pre>
  
  <p>What is the best way to write this.
  Please, write your snippet.</p>