Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #51 from DamianEdwards/master

Async fixes - Thanks dude!
  • Loading branch information...
commit aee0488d95baa4808cbe1e81d8738fbd8bb60f10 2 parents bdfd2a2 + 6424009
@robconery robconery authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 Massive.cs
View
7 Massive.cs
@@ -1,4 +1,5 @@
using System;
+using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration;
@@ -120,11 +121,11 @@ public class DynamicModel:DynamicObject {
}
}
/// <summary>
- /// Enumerates the reader yielding the result - thanks to Jeroen Haegebaert
+ /// Executes the reader using SQL async API - thanks to Damian Edwards
/// </summary>
public void QueryAsync(string sql, Action<List<dynamic>> callback, params object[] args) {
- using (var conn = OpenConnection()) {
- var cmd = new SqlCommand(sql,new SqlConnection(_connectionString));
+ using (var conn = new SqlConnection(_connectionString)) {
+ var cmd = new SqlCommand(sql, new SqlConnection(_connectionString));
cmd.AddParams(args);
cmd.Connection.Open();
var task = Task.Factory.FromAsync<IDataReader>(cmd.BeginExecuteReader, cmd.EndExecuteReader, null);
Please sign in to comment.
Something went wrong with that request. Please try again.