subsonic中的事务

添加引用 using System.Transactions;

using (TransactionScope scope = new TransactionScope())
        {
            try
            {
                OrderSellerList osl1 = new OrderSellerList();
                osl1.OrderId = 9;
                osl1.SellerId = 2;
                osl1.UserId = 1;

                osl1.Save();
                OrderSellerList osl2 = new OrderSellerList();
                osl2.OrderId = 200;
                osl2.SellerId = 2;
                osl2.UserId = 1;

                osl2.Save();
                scope.Complete();
            }
            catch{}
        }


http://www.keyusoft.cn/(S(prgsxrrzofjzfw45inpjehib))/UsingSubSonicToCreateASimpleBogEngine.ashx

你可能感兴趣的:(BSON)