从Object生成DTO [英] Generate DTOs from Object
本文介绍了从Object生成DTO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
这是一个黑客,您可以使用Visual Studio / Resharper从类中提取一个接口,然后创建一个DTO类并从该接口派生,然后使用Visual Studio自动实现接口成员(然后,可选地删除接口)。
I want to auto gen some DTOs from some of my existing objects, I was wondering if there already exist a Resharper, DevExpress or VSX open source to use, I need a tool to look into my code and let me choose which properties I want to include in my DTO and then generate a class based on that...
解决方案
This is kind of a hack but you could use Visual Studio/Resharper to Extract an interface from the class, then create a DTO class and derive from the interface, then use Visual Studio to auto implement the interface members (then, optionally remove the interface).
这篇关于从Object生成DTO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文