change how XmlSerializer serializes empty elements

后端 未结 2 436
滥情空心
滥情空心 2020-12-18 11:49

I am using the XmlSerializer. It serializes the object just fine but the client requires required empty elements to be in this format . Th

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-18 12:20

    You can try setting the XmlElementAttribute.IsNullable property to true. However, bear in mind xsi:nil="true" attribute will be output as a consequence.

提交回复
热议问题