当你的才华不能撑起你的野心时,就是你该选择学习的时候了!

C#-TransactionScope

using System.Transactions;
TransactionOptions op = new TransactionOptions() { IsolationLevel = IsolationLevel.ReadCommitted };
            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, op))
            {
                using (CCEntities dm = new CCEntities(AppConfig.GetCreditCheckConnStr()))
                {
                    dm.PCR_IdentifiableInformation.AddObject(info);

                    dm.SaveChanges();
                }
                scope.Complete();
            }

 

posted @ 2020-06-03 11:33  hofmann  阅读(149)  评论(0编辑  收藏  举报