2011-03-21 124 views

回答

2

您必須使用TransactionScope

using (var scope = new TransactionScope(TransactionScopeOption.Required, 
     new TransactionOptions { IsolationLevel = IsolationLevel.RepetableRead})) 
{ 
    // Grab data 
    // Process changes 
    context.SaveChanges(); 
    scope.Complete(); 
}