You are developing an ASP.NET MVC application. The application is an order processing system that uses the
ADO.NET Entity Framework against a SQL Server database. It has a controller that loads a page that displays
all orders along with customer information. Lazy loading has been disabled.
The Order class is shown below.
You need to return the orders and customer information in a single round trip to the database.
Which code segment should you use?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
D? lazyloading has been disable.
No, A is correct. Since lazy loading is disabled you have to load the customers by calling the Include method.
See https://msdn.microsoft.com/en-us/library/jj574232(v=vs.113).aspx (eagerly loading)
“orders and customer information” – where are your customers in D?