Serialize A List<T> Produces Flat Results C#


Have you serialzied an object that had a List<T> as a property, and the list is flattened when it gets to XML?



This occurs if you have the property marked as [XmlElement("name")].  instead mark the property as [XmlArray("name")] and you will get parent child nodes for your List<T>



There are no notes on this topic