Microsoft Exam Questions

How should you complete the relevant code?

DRAG DROP
An application serializes and deserializes XML from streams. The XML streams are in the following
format:

The application reads the XML streams by using a DataContractSerializer object that is declared by
the following code segment:
var ser = new DataContractSerializer(typeof(Name));
You need to ensure that the application preserves the element ordering as provided in the XML
stream.
How should you complete the relevant code? (To answer, drag the appropriate attributes to the
correct locations in the answer area-Each attribute may be used once, more than once, or not at all.
You may need to drag the split bar between panes or scroll to view content.)

Answer:

Explanation:

DataContractAttribute – Specifies that the type defines or implements a data contract and is
serializable by a serializer, such as the DataContractSerializer. To make their type serializable, type
authors must define a data contract for their type.
http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx
DataMemberAttribute – When applied to the member of a type, specifies that the member is part of
a data contract and is serializable by the DataContractSerializer.
http://msdn.microsoft.com/en-us/library/ms574795.aspx