资讯

Using TransactionScope simplifies this code tremendously by enclosing every ADO.NET call within a transaction -- even when the call is inside another method. You need to add a reference to ...
using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew)) { // Write code here to call the service methods of your services here.
If you do need something different (to combine several SaveChanges calls into a single transaction or to combine EF code with ADO.NET code in a transaction), then your first choice should be the ...