How to: Specify When Concurrency Exceptions are Thrown
Before you submit your changes to the database, you can specify when concurrency exceptions should be thrown:
Throw the exception at the first failure (FailOnFirstConflict).
Finish all update tries, accumulate all failures, and report the accumulated failures in the exception (ContinueOnConflict).
When thrown, the ChangeConflictException exception provides access to a ChangeConflictCollection collection. This collection provides details for each conflict (mapped to a single failed update try), including access to the MemberConflicts collection. Each member conflict maps to a single member in the update that failed the concurrency check.
The following code shows examples of both values.
Northwnd db = new Northwnd("..."); // Create, update, delete code. db.SubmitChanges(ConflictMode.FailOnFirstConflict); // or db.SubmitChanges(ConflictMode.ContinueOnConflict);