SimpleStack/simplestack.orm

Create table on closed connection do not throw exception

Closed this issue · 1 comments

    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();
        }
    }

This is a ... feature... of Dapper.

Dapper will open and close the connection automatically if the connection is not open