DTO对象设计
我有客户对象包含他的联系信息、交易详细信息、地址详细信息。
这里如何设计我的 DTO 对象来保存所有信息。我将输出作为 xml 文件。这里我想自动将 xml 映射到 dto 对象。
请给我任何建议。
问候, 柴图
I have customer object contains his contact information,transaction details,address details.
Here how to design my DTO object to hold all the information.I am getting output as xml file.Here i want to map xml to dto object automatically.
Please give me any suggestions.
Regards,
Chaitu
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有足够的细节来给你一个正确的答案,但我会尝试一下。据我了解,您需要将客户详细信息(基于 XML)映射到一种 DTO 对象。我认为一个好的解决方案是将客户 XML 反序列化为您需要创建的 DTO 对象。看看
http://savagelook.com /blog/portfolio/quick-tip-deserializing-xml-to-objects-in-c
http://www.codingday.com/xml-c-class-generator-for-c-using-xsd-for-deserialization/
I don’t have enough details to give you a proper answer but I’ll try to give it a go. For what I have understood you need to map the customers details (XML based) to a kind of DTO object. I think a good solution could be deserialize the customer XML to the DTO object you need to create. Have a look at
http://savagelook.com/blog/portfolio/quick-tip-deserializing-xml-to-objects-in-c
http://www.codingday.com/xml-c-class-generator-for-c-using-xsd-for-deserialization/