ジョン、いいえ、TransactionScope を使用する必要はありません。オプティミスティック コンカレンシーは、Linq によって自動的に処理されます。あなたが提供するリンクのコードサンプルは、トランザクションを自分でロールバックする必要がないことをかなりうまく説明しています。サンプルと同じコードを使用します。
try
{
// Try to save changes, which may cause a conflict.
int num = context.SaveChanges();
Console.WriteLine("No conflicts. " +
num.ToString() + " updates saved.");
}
catch (OptimisticConcurrencyException)
{
// Resolve the concurrency conflict by refreshing the
// object context before re-saving changes.
context.Refresh(RefreshMode.ClientWins, orders);
// Save changes.
context.SaveChanges();
Console.WriteLine("OptimisticConcurrencyException "
+ "handled and changes saved");
}
あなたの懸念を処理する更新、再保存に注意してください。これは、try ブロック内から例外をスローすることでテストできます。
よろしくお願いします