You are implementing a Windows Communication Foundation (WCF) service that uses Entity Framework. Several service methods will return entities; other methods will write changes made to entities to the database. You need to decide when to create the ObjectContext and how to configure the ObjectContext to use minimal memory.

What should you do?

 Posted by Rajkatie on 8/31/2012 | Category: ADO.NET Interview questions | Views: 1070 | Points: 40
Select from following answers:
  1. Create an ObjectContext within each service method. Execute queries with the MergeOption set to NoTracking.
  2. Create an ObjectContext singleton. Set the LazyLoadingEnabled property of the related ObjectContextOptions to True.
  3. Create an ObjectContext singleton. Set the LazyLoadingEnabled property of the related ObjectContextOptions to False.
  4. All Above

Show Correct Answer


Source: MeasureUp.com | | Alert Moderator 

Comments or Responses

Login to post response