Which code segment should you use?

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?

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



Leave a Reply 7

Your email address will not be published. Required fields are marked *


JHFJHF

JHFJHF

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.”

Tom

Tom

I think that “D” is correct as well. The result of “D” will be the same as result of “A”.

MN

MN

You need to return orders with their filtered “list” so need to add ToList();

BK

BK

I think C does not make sense – there are two calls to the db.