A collection type can be customized using the CollectionDataContract attribute instead of the DataContrac attribute. The CollectionDataContract attribute has Name and Namespace properties.
A collection type implements the IEnumerable interface. Types that implement the IDictionary or generic IDictionary<TKey, TValue> interfaces are dictionary collections. All others are list collections.
In order to serialize an object to JSON using the DataContractJSonSerializer object the following is required: The “DataMember” attribute is used to mark the properties to serialize (private or public). With this attribute is possible to set the output name of each property, if … Continue reading