public void Initialize()
        {
            using (var connection = new SqlConnection(ConnectionString))
            {
                connection.Open();

                var server = new Server(new ServerConnection(connection));

                // get the database
                const string databaseName = "TransactionScopeTests";
                Database transactionScopeTests = server.Databases[databaseName];

                if (null != transactionScopeTests)
                {
                    server.KillDatabase(databaseName);
                }

                transactionScopeTests = new Database(server, databaseName);

                transactionScopeTests.Create(false);

                using (SqlCommand sqlCommand = connection.CreateCommand())
                {
                    // ReSharper disable once AssignNullToNotNullAttribute
                    sqlCommand.CommandText = Resources.CreateTables;

                    sqlCommand.ExecuteNonQuery();
                }
            }
        }
Exemple #2
0
        static void Main()
        {
            DapperExtensions.DapperExtensions.SqlDialect = new SqliteDialect();

            var database = new Database();
            database.Create();
            database.Insert();
            database.SelectAll();
            database.Select();
            database.Paged();
        }