Change the order of elements when serializing XML

前端 未结 2 443
我寻月下人不归
我寻月下人不归 2020-12-06 08:58

I need to serialize an Object to XML and back. The XML is fix and I can\'t change it. I fail to generate this structure after bookingList.

How can I \"

2条回答
  •  渐次进展
    2020-12-06 09:53

    I was facing with this problem and i solved it... Well it is very interesting, and this is a bug in .net maybe.

    the problem is here: public List booking= new List();

    You should use: public List booking { get; set; }

    And you will get the defined order .... but why? who knows... :)

提交回复
热议问题