Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Async fixes #51

Merged
merged 1 commit into from

2 participants

@robconery robconery merged commit aee0488 into FransBouma:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 8, 2011
  1. updates to async API

    unknown authored
This page is out of date. Refresh to see the latest.
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);
Something went wrong with that request. Please try again.