我应该使用 Linq-to-SQL 还是 Castle ActiveRecord 实现?

发布于 2024-08-18 11:12:02 字数 411 浏览 1 评论 0原文

我不想再编写存储过程(除非必须),所以我应该使用开箱即用的 Linq-to-SQLCastle ActiveRecord实施

我知道两者之间存在一些差异,正如Stackoverflow

I don't want to write stored procedures any more (not unless I have to), so should I use out of the box Linq-to-SQL or the Castle ActiveRecord implementation?

I understand there are some differences between the two as mentioned here on Stackoverflow

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

2024-08-25 11:12:02

我想说,两者都尝试一下,看看哪一个最适合您的需求。问这样的问题你很可能会得到另一个答案——“我更喜欢哪一个”。没有一种适合所有情况的解决方案,并且您提供的细节很少,很难真正为您提供帮助。

请注意,ActiveRecord 在底层使用 NHibernate,这是一种比 L2S 更强大的 ORM,因此,如果您打算发展项目,从长远来看,它的灵活性和成熟度可能会有所帮助。

I would say try both, and see which suits your needs best. Asking questions like these you will most likely get another answer - "which one I like better". There's no one size fits all solution, and with little details you have given it's hard to help you really.

Notice that ActiveRecord uses NHibernate underneath, which is a much more powerful ORM than L2S, so if you intend your project to grow, it's flexibility and maturity may be helpful in the long run.

Bonjour°[大白 2024-08-25 11:12:02

我不确定你为什么只在这两者之间进行选择?

LinqToSql 目前拥有比 NHibernate 更好的 Linq 提供程序。

Castle ActiveRecord 基于 NHibernate。 NHibernate 的功能比 LinqToSql 丰富得多,并且向 NHibernate 添加功能的速度要快得多。

根据您的领域、数据模型和要求的复杂性,您可能在某些时候被迫使用 NHibernate,因为 LinqToSql 无法完成您需要它做的事情(您没有指定什么样的环境和要求)你有,这有很大的不同)。

从一种 ORM 过渡到另一种 ORM 可能很困难且成本高昂,因此明智地选择很重要。

在某些情况下,我会推荐 LinqToSql 而不是 Castle ActiveRecord,但这种情况很少见。一般来说,Castle ActiveRecord 更适合您的情况。

I'm not sure why you happen to be choosing between those two only?

LinqToSql currently has a better Linq provider than NHibernate.

Castle ActiveRecord is based on NHibernate. NHibernate is a lot more feature rich than LinqToSql and features are being added much more quickly to NHibernate.

Depending on the complexity of your domain, data model, and requirements, you may be forced to go with NHibernate at some point because LinqToSql just can't do what you need it to do (you haven't specified what kind of environment and requirements you have, which makes a big difference).

It can be difficult/expensive to transition from one ORM to another, so it is important to choose wisely.

There are some situations where I would recommend LinqToSql over Castle ActiveRecord, but they are few and far between. Generally, Castle ActiveRecord is much more likely to work in your situation.

小巷里的女流氓 2024-08-25 11:12:02

使用 Linq to SQL - 它非常容易上手,并且有很多相关文档。此外,您不需要对任何外部的东西有任何依赖,这将节省您的时间。

Use Linq to SQL - its very easy to get started and there is a lot of documentation out there for it. In addition you don't need to take any dependencies on anything outside the box, which will save you time.

只有影子陪我不离不弃 2024-08-25 11:12:02

由于实体框架,Linq-to-SQL 似乎正在节节败退。由于 EF 与许多新的和即将推出的 MS 技术完美集成,因此您可能不会后悔使用 EF。不知道它与 Casle tuogh 相比如何。

Linq-to-SQL seems to be loosing ground due to Entity Framework. Since EF integrates nicely with many new and upcoming MS technologies, you probably would not regret using EF. Not sure how it fares in comparison with Casle thuogh.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文