问题描述
我有业务对象(DEVELOPERS WRITE)和一些 SPROCS(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.
推荐答案
SubSonic 对 sproc 有很好的支持.它将每个都包装在一个辅助方法中,如果需要,您可以从结果中检索强类型集合或实体.我在这篇博文一>.只要您的 sproc 返回与 SELECT * FROM TableName 相同的架构,它就会与您的 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.
至于基于您的数据库生成类,SubSonic 生成部分类,因此您可以根据需要扩展它们.您还可以将 SubSonic 生成的类映射到您的实际模型.
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 最好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!