Created
September 15, 2013 08:55
-
-
Save tugberkugurlu/6569018 to your computer and use it in GitHub Desktop.
SqlDataReader Select extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Extensions { | |
public static IEnumerable<T> Select<T>( | |
this SqlDataReader reader, Func<SqlDataReader, T> projection) { | |
while (reader.Read()) { | |
yield return projection(reader); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment