Data Contract Serializer - How to omit the outer element of a collection

前端 未结 3 737
星月不相逢
星月不相逢 2020-11-28 16:13

How do I serialize a list without the outer element using the Data Contract Serializer? I am using .Net 3.5. I have a class that contains a list, amongst

3条回答
  •  萌比男神i
    2020-11-28 16:27

    The DataContract serializer does not allow this degree of control over the resulted XML, you will have to use instead the XmlSerializer in order to achieve this.

提交回复
热议问题