Which code segment should you add?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.

The application contains two entities named Customer and Order. The Customer entity has a navigable property named Orders. The Orders property returns a collection of Order entity instances.

You write the following code segment.

ContosoEntities context = new ContosoEntities();
ObjectQuery<Customer> query;

You need to ensure that each time a Customer entity instance is queried the related Order entity instances are retrieved.

Which code segment should you add?

You create an application by using the Microsoft .NET Framework 3.5 and Microsoft ADO.NET.

The application contains two entities named Customer and Order. The Customer entity has a navigable property named Orders. The Orders property returns a collection of Order entity instances.

You write the following code segment.

ContosoEntities context = new ContosoEntities();
ObjectQuery<Customer> query;

You need to ensure that each time a Customer entity instance is queried the related Order entity instances are retrieved.

Which code segment should you add?

A.
query = context.Customer.Include("Orders");

B.
query = context.CreateQuery<Customer>("Orders");

C.
query = context.Customer;
query.Select("Orders");

D.
query = context.Customer;
query.Parameters.Add(new ObjectParameter("Orders",""));



Leave a Reply 0

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