DBContext的事务性封装
It is not necessary to wrap your SaveChanges call in another TransactionScope if; If you are not trying to use multiple context in the same transaction. If you are not making multiple SaveChanges calls even with the same context. For instance, one SaveChanges after Delete, another SaveChanges after add... In summary, you can do multiple delete/add operations with the same context, and call the SaveChanges method once in the end - they will all be applied in one transaction. TransactionScope is only necessary if you have nested transaction scenarios.
 
                    
                
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号