nerdexam
Microsoft

70-516 · Question #113

70-516 Question #113: Real Exam Question with Answer & Explanation

Sign in or unlock 70-516 to reveal the answer and full explanation for question #113. The question stem and answer options stay visible for context.

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application connects to a Microsoft SQL Server database. The application uses the ADO.NET Entity Framework to model entities. The database includes objects based on the exhibit. The application includes the following code segment. (Line numbers are included for reference only.) 01 using (AdventureWorksEntities context = new AdventureWorksEntities()){ 02 ... 03 foreach (SalesOrderHeader order in customer.SalesOrderHeader){ 04 Console.WriteLine(String.Format("Order: {0} ", order.SalesOrderNumber)); 05 foreach (SalesOrderDetail item in order.SalesOrderDetail){ 06 Console.WriteLine(String.Format("Quantity: {0} ", item.Quantity)); 07 Console.WriteLine(String.Format("Product: {0} ", item.Product.Name)); 08 } 09 } 10 } You want to list all the orders for a specified customer. You need to ensure that the list contains the following fields: - Order number - Quantity of products - Product name Which code segment should you insert at line 02?

Options

  • AContact customer = context.Contact.Where("it.ContactID = @customerId",
  • BContact customer = context.Contact.Where("it.ContactID = @customerId",
  • Ccontext.ContextOptions.LazyLoadingEnabled = true;
  • DContact customer = (from contact in context.Contact

Unlock 70-516 to see the answer

You've previewed enough free 70-516 questions. Unlock 70-516 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 70-516 Practice