Dapper 事务处理

例子:

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

 

posted @ 2018-09-01 10:06  lunawzh  阅读(260)  评论(0编辑  收藏  举报