Skip to content

Instantly share code, notes, and snippets.

@bdukes
bdukes / DataReaderEnumerable.cs
Created March 16, 2011 18:58
The DataReaderEnumerable is a simple class that wraps an IDataReader and implements IEnumerable<IDataReader>. This allows all of the LINQ methods to be used on an IDataReader.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics.CodeAnalysis;
/// <summary>
/// Enumerates over an <see cref="IDataReader"/> instance, moving to the next record upon each enumeration.
/// </summary>
/// <remarks>