70-516 · Question #83
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL. The application contains the following model. You write the following code…
The correct answer is D. Order newOrder = new Order(). See the full explanation below for the reasoning.
Question
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL. The application contains the following model. You write the following code. (Line numbers are included for reference only.) 01 static void Insert() 02 { 03 NorthwindDataContext dc = new NorthwindDataContext(); 04 Customer newCustomer = new Customer(); 05 newCustomer.Firstname = “Todd”; 06 newCustomer.Lastname = “Meadows”; 07 newCustomer.Email = “[email protected]”; 08 ..... 09 dc.SubmitChanges(); 10 } A product named Bike Tire exists in the Products table. The new customer orders the Bike Tire product. You need to ensure that the correct product is added to the order and that the order is associated with the new customer. Which code segment should you insert at line 08?
Exhibit
Options
- AOrder newOrder = new Order();
- BProduct newProduct = new Product();
- CProduct newProduct = new Product();
- DOrder newOrder = new Order();
How the community answered
(28 responses)- A7% (2)
- B14% (4)
- C7% (2)
- D71% (20)
Community Discussion
No community discussion yet for this question.
