Contents tagged with XML

  • XML Serialization of a Collection with properties

    In this particular project we needed to serialize a collection of items and include an attribute in each one. Saddly, XmlSerializer seems to not support that directly but there is a workaround: use containment instead of derivation and then apply the [XmlElement] attribute to the collection property to get rid of the unwanted wrapping xml tag. For example: