HOTSPOT
You have an existing order processing system that accepts .xml files,
The following code shows an example of a properly formatted order in XML:
You create the following class that will be serialized:
For each of the following properties, select Yes if the property is serialized according to the defined
schema Otherwise, select No.
no no yes
no yes yes
answer is no no yes ,because orderdate has no attribute DataMember
orderdate doesnt need one. it is public
no yes yes
this reply made me smile
no no yes
As of .NET 3.5 SP1, WCF will happily serialize classes without any [DataContract] and [DataMember] attributes… but as soon as you start using one of those attributes, then this “default” behavior will stop working – as soon as you have a single [DataMember] in your class, from that point on, only those properties with this attribute will be serialized
yes no yes
The Id will be also serialized as long as it has the [DataMember] attribute.
Since “Name” member is not defined for the ID, by default, the CLR member name is used as the name of the data member. By setting the Name property, you can customize the name of the data member.
From : Practical Microsoft SOA
Members of a class that are not explicitly marked with the [DataMember] attribute are not automatically serialised, regardless of their accessibility level
No, No, Yes
OrderID will be zero if you try to load it from XML
https://stackoverflow.com/questions/1644004/how-do-i-add-an-xml-attribute-using-datacontract