Created
September 11, 2013 21:04
-
-
Save dshookowsky/6529765 to your computer and use it in GitHub Desktop.
Reader object to expando
This file contains 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
private dynamic SqlDataReaderToExpando(DbDataReader reader) | |
{ | |
var expandoObject = new ExpandoObject() as IDictionary<string, object>; | |
for (var i = 0; i < reader.FieldCount; i++) | |
expandoObject.Add(reader.GetName(i), reader[i]); | |
return expandoObject; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment