I just started playing around with Dapper. So far i love it. Does dapper not work with TransactionScope
? I noticed that even if i never call TransactionSc
It was totally my fault and not fully understanding transactionscope. A connection is not automatically enlisted in transactionscope unless you open the connection within the transactionscope:
Automatic Enlistment
using (var scope = new TransactionScope())
{
con.Open();
//update/delete/insert commands here
}
Manual Enlistment
con.Open();
using (var scope = new TransactionScope())
{
con.EnlistTransaction(Transaction.Current);
//update/delte/insert statements here
}
Details can be found here: Details