Create table on closed connection do not throw exception
Closed this issue · 1 comments
pierresebastien commented
public class Bar
{
[PrimaryKey]
public int Id { get; set; }
}
[Test]
public void TestCreateTableConnectionClosed()
{
using (OrmConnection connection = new SqliteDialectProvider().CreateConnection(":memory:"))
{
Assert.Throws<Exception>(() => connection.CreateTable<Bar>(true));
connection.Close();
}
}
vdaron commented
This is a ... feature... of Dapper.
Dapper will open and close the connection automatically if the connection is not open