Select from following answers:- Create an ObjectContext within each service method. Execute queries with the MergeOption set to NoTracking.

- Create an ObjectContext singleton. Set the LazyLoadingEnabled property of the related ObjectContextOptions to True.
- Create an ObjectContext singleton. Set the LazyLoadingEnabled property of the related ObjectContextOptions to False.
- All Above
To minimize memory usage and complexity, create an ObjectContext within each service method. Execute queries with the MergeOption set to NoTracking. Memory used by the ObjectContext will be disposed after the object is returned. Setting the MergeOption to NoTracking will minimize memory usage before the ObjectContext is disposed.
If you set MergeOption to AppendOnly, the ObjectContext's ObjectStateManager will track object state. This tracking is not needed. Set MergeOption to NoTracking instead.
Show Correct Answer
Source: MeasureUp.com | |
Alert Moderator