XmlSerializer vs DataContractSerializer

China☆狼群 提交于 2019-12-06 08:52:48

问题


I just realized that DataContractSerializer expects nodes in the alphabetical order or the specified order. Is there any way i could make it NOT do it?

TIA


回答1:


I don't think so. You may find the discussion on this question informative:

Ignore field order in DataContractSerializer




回答2:


I used IDispatchMessageInspector.AfterReceiveRequest to intercept the message and sort it alphabetically.



来源:https://stackoverflow.com/questions/3570729/xmlserializer-vs-datacontractserializer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!