, , TransactionScope. concurrency Linq. , , . , :
try
{
int num = context.SaveChanges();
Console.WriteLine("No conflicts. " +
num.ToString() + " updates saved.");
}
catch (OptimisticConcurrencyException)
{
context.Refresh(RefreshMode.ClientWins, orders);
context.SaveChanges();
Console.WriteLine("OptimisticConcurrencyException "
+ "handled and changes saved");
}
, , . , try.