nerdexam
Microsoft

70-516 · Question #72

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

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

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. Entity types in the model are generated by the Entity Data Model generator tool (EdmGen.exe). You write the following code. (Line numbers are included for reference only.) 01 MemoryStream stream = new MemoryStream(); 02 var query = context.Contacts.Include("SalesOrderHeaders.SalesOrderDetails"); 03 var contact = query.Where("it.LastName = @lastname", new ObjectParameter("lastname", lastName)).First(); 04 .... You need to serialize the contact and all of its related objects to the MemoryStream so that the contact can be deserialized back into the model. Which code segment should you insert at line 04?

Options

  • Avar formatter = new XmlSerializer(typeof(Contact), new Type[]
  • Bvar formatter = new XmlSerializer(typeof(Contact));
  • Cvar formatter = new BinaryFormatter();
  • Dvar formatter = new SoapFormatter();

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