例子:
using (var connection = GetOpenConnection()) using (var transaction = connection.BeginTransaction()) { connection.Execute( "INSERT INTO data(Foo, Bar) values (@Foo, @Bar);", list, transaction); transaction.Commit(); }
例子:
using (var connection = GetOpenConnection()) using (var transaction = connection.BeginTransaction()) { connection.Execute( "INSERT INTO data(Foo, Bar) values (@Foo, @Bar);", list, transaction); transaction.Commit(); }