Permalink
Browse files

added missing using statement to reader

  • Loading branch information...
1 parent 8a514ee commit 3acd477cfc16bc12459d9a51af54b7e424b85eb4 @davidsavagejr committed Aug 10, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 Massive.cs
View
@@ -195,9 +195,12 @@ public class DynamicModel : DynamicObject {
/// </summary>
public virtual IEnumerable<dynamic> Query(string sql, params object[] args) {
using (var conn = OpenConnection()) {
- var rdr = CreateCommand(sql, conn, args).ExecuteReader();
- while (rdr.Read()) {
- yield return rdr.RecordToExpando(); ;
+ using (var rdr = CreateCommand(sql, conn, args).ExecuteReader())
+ {
+ while (rdr.Read())
+ {
+ yield return rdr.RecordToExpando(); ;
+ }
}
}
}

0 comments on commit 3acd477

Please sign in to comment.