Skip to content

Instantly share code, notes, and snippets.

@tugberkugurlu
Created September 15, 2013 08:55
Show Gist options
  • Save tugberkugurlu/6569018 to your computer and use it in GitHub Desktop.
Save tugberkugurlu/6569018 to your computer and use it in GitHub Desktop.
SqlDataReader Select extension
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