Commit fb04a9cb authored by Sam's avatar Sam

Merge pull request #61 from TheDavester/master

Fixed DapperTable issue
parents 86d6454a b82c2750
......@@ -2253,6 +2253,24 @@ public void Open()
}
}
public void TestDapperTableMetadataRetrieval()
{
// Test for a bug found in CS 51509960 where the following sequence would result in an InvalidOperationException being
// thrown due to an attempt to access a disposed of DataReader:
//
// - Perform a dynamic query that yields no results
// - Add data to the source of that query
// - Perform a the same query again
connection.Execute("CREATE TABLE #sut (value varchar(10) NOT NULL PRIMARY KEY)");
connection.Query("SELECT value FROM #sut").IsSequenceEqualTo(Enumerable.Empty<dynamic>());
connection.Execute("INSERT INTO #sut (value) VALUES ('test')").IsEqualTo(1);
var result = connection.Query("SELECT value FROM #sut");
var first = result.First();
((string)first.value).IsEqualTo("test");
}
#if POSTGRESQL
class Cat
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment