Skip to content

Commit

Permalink
Merge pull request #41 from daveclarke/master
Browse files Browse the repository at this point in the history
Convert DBNull to null
  • Loading branch information
robconery committed May 9, 2011
2 parents 976ca19 + 007d200 commit 8964785
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Massive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public static List<dynamic> ToExpandoList(this IDataReader rdr) {
public static dynamic RecordToExpando(this IDataReader rdr) {
dynamic e = new ExpandoObject();
var d = e as IDictionary<string, object>;
for (int i = 0; i < rdr.FieldCount; i++)
d.Add(rdr.GetName(i), rdr[i]);
for (int i = 0; i < rdr.FieldCount; i++)
d.Add(rdr.GetName(i), DBNull.Value.Equals(rdr[i]) ? null : rdr[i]);
return e;
}
/// <summary>
Expand Down

0 comments on commit 8964785

Please sign in to comment.