研究M$的petshop4.0代码时发现了TransactionScope。
它可以控制多个操作在同一个事务内完成。这对于把事务放在业务逻辑层的人来说确实很方便。
petshop代码:
BLL层下的OrderSynchronous.cs
.net2.0 TransactionScope petshopusing System.Transactions;
.net2.0 TransactionScope petshop
//.net2.0 TransactionScope petshop
        }

using(TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
{
    //...
    ts.Complete();
}

相关文章:

  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-10
猜你喜欢
  • 2021-09-26
  • 2021-11-22
相关资源
相似解决方案