You are implementing an application that uses Entity Framework-generated entities to update a data source. You add a method that retrieves a Product entity and changes its Status property. You need to ensure that the Entity Framework will throw an exception if a value in the data source changes between the time that your method retrieves the Product and the time the Product saves changes to it.

What should you do?

 Posted by Rajkatie on 9/20/2012 | Category: ADO.NET Interview questions | Views: 1434 | Points: 40
Select from following answers:
  1. Call the ObjectContext's Refresh method. Set the RefreshMode to ClientWins.
  2. In the Entity Data Model, add a property to the Product entity definition. Set the ConcurrencyMode of the property to Fixed.
  3. Call the ObjectContext's SaveChanges method with the SaveOptions set to DetectChangesBeforeSave.
  4. All Above

Show Correct Answer

Source: MeasureUp.Com | | Alert Moderator 

Comments or Responses

Login to post response