You are developing an order processing application that uses the ADO.NET Entity
Framework against a SQL Server database. Lazy loading has been disabled. The
application displays orders and their associated order details. Order details are filtered
based on the category of the product in each order.
The Order class is shown below.
You need to return orders with their filtered list of order details included 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
Correct answer is A because “You need to return orders with their filtered list of order details included IN A SINGLE ROUND TRIP to the database.”
I think that “D” is correct as well. The result of “D” will be the same as result of “A”.
You need to return orders with their filtered “list” so need to add ToList();
I think C does not make sense – there are two calls to the db.
I agree the answer is A.
This is a second call to the database:
var orders = db.OrdersWhere(o=> orderIDs.Contains(o.OrderID));
Why not b
sorry is B wrong ans here
http://www.aiotestking.com/microsoft/which-code-segment-should-you-use-1050/#comment-967093