ADO.NET 实体框架与 NHibernate [英] ADO.NET Entity Framework vs NHibernate

查看:30
本文介绍了ADO.NET 实体框架与 NHibernate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,ADO.NET 实体框架受到了一些负面报道(以博客条目和请愿书的形式),但我不想急于做出判断.我的实验时间有限,但我想知道是否有人使用过它并获得了更多的经验反馈?

So the ADO.NET Entity Framework has gotten a little bit of bad press (in the form of blog entries and a petition) but I don't want to rush to judgement. I'm limited in time for experimentation but I was wondering has anyone worked with it yet with more empirical feedback?

最后,对于使用已经存在很长时间并且可能比 ADO.NET Entity Framework 更成熟的 NHibernate 有什么想法.

Finally, what are thoughts on using NHibernate which has been around for a long time and may be more mature than the ADO.NET Entity Framework.

推荐答案

NHibernate 可能更成熟一些.这并不一定意味着它是一个更好"的解决方案.在我的工作中使用它一段时间后,我个人更喜欢使用几乎任何东西而不是 NHibernate(即使是直接的 SQL,如果迁移是远程可行的).NHibernate 抛出的错误消息的数量没有任何意义(或者确实意味着一些事情但不应该发生)绝对惊人,因为它的一些默认行为(例如为 Find 中返回的每个对象刷新一次会话)).

NHibernate may be more mature. That does not necessarily mean it is a "better" solution. Having used it at my job for some time, I would personally prefer to use almost anything than NHibernate (even straight SQL, if migration were remotely feasible). The number of error messages thrown by NHibernate that don't mean anything (or that do mean something but should never occur) is absolutely staggering, as are some of its default behaviours (such as flushing the session once for each object returned in a Find).

就我个人而言,当我有选择时,我使用 LINQ to SQL 来处理所有数据库工作.

Personally, when I have a choice, I use LINQ to SQL for all database work.

这篇关于ADO.NET 实体框架与 NHibernate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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