我可以使用什么SQL ORM替换此旧代码 [英] What SQL ORM may i use to replace this old code

查看:77
本文介绍了我可以使用什么SQL ORM替换此旧代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,因为这个问题是我的特定问题.

Sorry since this question is specific to my problem.

在学习思考的同时,我在一周内做了一个小型SQL ORM,然后在使用一周的时间里进行了细微的调整.由于它投入的工作很少,因此它实际上仅与sqlite兼容.到目前为止,我的代码还没有遇到问题,但是我想将其移植到支持TSQL或MySql的东西上.

While learning reflections i did a mini SQL ORM in a week then minor tweaks while using it for another week. Since it has very little work put into it, its really only compatibility with sqlite. I havent had problems with the code so far but i would like to port it to something that supports TSQL or MySql.

示例代码在此处,它已经过时了,但在我的课程中功能最丰富.我也可以用最小的痛苦就将该代码移植到哪个库中.请注意,它必须支持外键.

The example code is here which is outdated but has the most used functions in my class. What library can i port that code over too with the smallest about of pain. Note that it must support foreign keys.

推荐答案

对于这样一个简单的数据模型,我将考虑使用Linq 2 Sql或SubSonic,并且倾向于SubSonic.

For such a simple data model I would look at using either Linq 2 Sql or SubSonic, with a lean towards SubSonic.

我使用的是Lightspeed 2,但没有使用新发布的版本3.因此,Lightspeed 3也可能是一个不错的选择.在我们的Lightspeed项目中,我们还研究了其他六个或七个ORM,包括nHibernate.光速是第二快的.最快的ORM生成了一些非常时髦的模型!

I have used Lightspeed 2, but not the newly release version 3. So Lightspeed 3 could also be a good choice. For our Lightspeed project we also looked at six or seven other ORMs, including nHibernate. Lightspeed was the second fastest. The fastest ORM generated some really funky models!

任何提及的ORM加上未提及的ORM都会全部完成.我认为这取决于您要为对象建模付出多少努力以及您的个人喜好是什么.

Any one of the ORMs mentioned plus those not mentioned will all do the job. I think it will come down to how much effort you want to take to model your objects and what your personal preferences are.

我更喜欢SubSonic,因为您要做的就是在T4模板中设置三个变量并将其放入文件夹中.所有代码都会自动生成.另外,如果需要,您可以根据自己的喜好来选择模板.

I prefer SubSonic because all you have to do is set three variables in a T4 template and drop into a folder. All the code gets generated automatically. Also if needed you can tweek the templates to your liking.

这篇关于我可以使用什么SQL ORM替换此旧代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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