TransactionScope, where is begin transaction on sql profiler?
问题 i need to do something like this on a transaction context using(var context = new Ctx()) { using (TransactionScope tran = new TransactionScope()) { decimal debit = 10M; int id = 1; var data = context.Cashier .Where(w => w.ID == id) .Select(s => new{ s.Money }) .Single(); Cashier cashier = new Cashier(){ ID = id }; context.Cashier.Attach(cashier); cashier.Money = data.Money - debit; context.Entry(cashier).Property(p => p.Money ).IsModified = true; context.SaveChanges(SaveOptions.None); tran