You work as Web Developer in PassGuide.com. The company uses Microsoft .NET Framework 4
as its application development platform. You are using plain old CLR objects and you want to
enable lazy loading. Which of the following actions you can take to accomplish the task?
Each correct answer represents a complete solution. Choose two.
A.
Mark the properties that you want to lazy load as private.
B.
Set the CommandTimeOut to 120 on the ObjectContext
C.
Set the LazyLoadingEnabled to true on the object context’s ContextOptions.
D.
Mark the properties that you want to lazy load as virtual.
Explanation:
http://www.entityframeworktutorial.net/EntityFramework4.3/lazy-loading-with-dbcontext.aspx
Rules for lazy loading:
1) context.Configuration.ProxyCreationEnabled should be true.
2) context.Configuration.LazyLoadingEnabled should be true.
3) Navigation property should be defined as public, virtual. Context will NOT do lazy loading if the property is not define as virtual.