public void Transactions_AdoNet() { using (var tx = db.EnsureInTransaction()) { // Connection is automatically opened if not open Transactions_DoWork(); tx.Commit(); } // Connection is closed if wasn't open }
public void Transactions_AdoNet() { using (var tx = db.EnsureInTransaction()) { // Connection is automatically opened if not open Transactions_DoWork(); tx.Commit(); } // Connection is closed if wasn't open }