Select from following answers:- Call the ObjectContext's Refresh method. Set the RefreshMode to ClientWins.
- In the Entity Data Model, add a property to the Product entity definition. Set the ConcurrencyMode of the property to Fixed.
- Call the ObjectContext's SaveChanges method with the SaveOptions set to DetectChangesBeforeSave.
- All Above
By default, the Entity Framework implements an optimistic concurrency model. This means that between the time when the data is queried and the time the data is updated, locks are not held on data in the data source. The Entity Framework saves object changes to the database without checking for concurrency. To ensure that values are checked for concurrency, you can define a property in the Entity Data Model's conceptual layer with an attribute of ConcurrencyMode="Fixed".
The ObjectContext's Refresh method updates an object in the object context with data from the data source. Setting the RefreshMode to StoreWins ensures that data source values overwrite client-side changes. This method does not throw an exception if the client values are different from data source values.
Show Correct Answer
Source: MeasureUp.Com | |
Alert Moderator