这ORM是使用存储过程的时候最好 [英] Which ORM is the best when using Stored Procedures

查看:460
本文介绍了这ORM是使用存储过程的时候最好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有业务对象(开发者编写)和一些存储过程(DBA WRITE)

I have Business objects (DEVELOPERS WRITE) and some SPROCS (DBA WRITE)

谁能推荐一个好对象映射器来处理这种设置。

Can anyone recommend a good object mapper to deal with this kind of setup.

我试过codesmith和NHibernate和遇到了麻烦。我不介意,如果我的ORM是免费或付费的。

I tried codesmith and nhibernate and had trouble. I do not mind if my ORM is free or paid.

推荐答案

亚音速具有存储过程很好的支持。这将包装每一个在一个辅助方法,你可以从结果中,如果你想检索强类型集合或实体。我给一个办法做到这一点在这篇博客。只要你的存储过程返回相同的模式作为SELECT * FROM表名会,它会与你SubSonic的实体。

SubSonic has excellent support for sprocs. It will wrap each one in a helper method and you can retrieve strongly-typed collections or entities from the results if you want. I show a way to do that in this blog post. As long as your sproc returns the same schema as SELECT * FROM TableName would, it will work with your SubSonic entities.

据生成基于您的数据库类,亚音速产生局部类,因此您可以根据需要扩展它们。你也可以做从亚音速映射生成的类到您的实际模型。

As far as generating classes based on your db, SubSonic generates partial classes so you can extend them as needed. You could also do mappings from the SubSonic generated classes to your actual model.

这篇关于这ORM是使用存储过程的时候最好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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