entiryFramework 事务控制

1、在项目中添加System.Transactions命名空间

2、在代码中编写如下代码段:

            using (var trans = new TransactionScope())
            {
                EF的代码
                trans.Complete();
            }

  

原文地址:https://www.cnblogs.com/feihusurfer/p/5173604.html