Select from following answers:- Add code to handle the OptimisticConcurrencyException exception. Log the error in this exception handler.

- Log the error if the SaveChanges method returns 0.
- Log the error if the SaveChanges method returns a value greater than 0.
- All Above
By default, the Entity Framework implements an optimistic concurrency model. You can define a property in the Entity Data Model's conceptual layer and set the ConcurrencyMode attribute to "Fixed". This will ensure that concurrency is checked. If the concurrency check fails when you call the SaveChanges method, SaveChanges will throw the OptimisticConcurrencyException. Handle this exception to detect concurrency failures.
The SaveChanges method will throw an OptimisticConcurrencyException, not a SqlException, if the concurrency check fails.
Show Correct Answer
Source: MeasureUp.Com | |
Alert Moderator