示例#1
0
        private void InsertValueInNewDb(bool commit)
        {
            var adapter = new MySQLCommandChannelFactory().Create(new CreationParameters <MySqlConnectionStringBuilder>(Credentials, Resources.TestCommitRollback, true));

            adapter.ExecuteInTransaction(scope =>
            {
                scope.Execute("INSERT INTO test (reference) VALUES (@value)", new Dictionary <string, IConvertible> {
                    { "@value", "committed" }
                });
                return(commit ? TransactionResult.Commit : TransactionResult.Rollback);
            });
        }