反对对象映射工具 [英] Object to Object Mapping Utility

查看:184
本文介绍了反对对象映射工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢干净独立的公共和域的对象的(因此,NHibernate的是不会在这里帮助)互相它最终迫使我写很多代码一个对象映射到另一个。什么工具/插件是那里拿不必手动做.NET?m做到这一点映射每当我谷歌这一点,以为我想这样做的ORM,这是乏味的的什么我在找。 !谢谢

I like to cleanly separate public and domain objects (so, nHibernate isn't going to help here) from each other which ends up forcing me to write a lot of code to map one object to another. What tools/plugins are out there to take the tedium of having to do manually do this mapping in .NET?m Whenever I Google this, it thinks I'm wanting to do ORM, which is not what I'm looking for. Thanks!

编辑19:33CST:OK,我写了一个非常基本的应用程序(很快编写的代码),演示了什么我要找的。我只是想知道如果有一个VS插件,会为我做到这一点。

EDIT 19:33CST: OK, I wrote a very basic application (very quickly written code) that demonstrates what I'm looking for. I'm just wondering if there is a VS plugin that will do this for me.

VS2008解决方案

推荐答案

所以,用一个运行时解决方案看似不满,我写了一个小工具,将在代码中创建的映射。您也可以下载源代码的下方,写更好的错误处理,等等,等等我会很感激您所做的任何修改凉爽,这是在仓促作出,但工程。请尊重代码正在 LGPL

So, seemingly dissatisfied with a runtime solution, I have written a small utility that will create the mappings in code. You can download the source below and write better error handling, etc., etc. I'd appreciate any cool modifications you make, this was made in haste, but works. Please respect that the code is being released under the LGPL.

对象到对象映射工具的源代码

更新2009年6月23日:我做了一些更新到清理它的代码(一点点),并加入到一个映射保存到一个文件的功能,使您可以在以后修改它。

UPDATE 23 JUN 2009: I made some updates to the code that cleaned it up (a little bit) and also added the ability to save a mapping to a file so that you can later modify it.

这篇关于反对对象映射工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆