LINQ2SQL VS EF在.NET Framework 4.0中 [英] Linq2SQL vs EF in .net Framework 4.0

查看:167
本文介绍了LINQ2SQL VS EF在.NET Framework 4.0中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么,什么是对,现在这两款产品的评​​价呢?我似乎无法就这个问题专门为VS2010发现了什么/ .NET 4.0

So what's the verdict on these two products now? I can't seem to find anything regarding this issue SPECIFICALLY for VS2010/.net 4.0

早在.NET 3.5天,大多数人都相信LINQ2SQL会死人的,当.NET 4.0恶有恶报,但似乎活得很好。

Back in .net 3.5 days, most people believe Linq2SQL will be dead when .net 4.0 comes around, but it seems alive and well.

在另一方面,EF 4.0似乎已经得到显著改善。

On the other hand, EF 4.0 seems to have gotten significant improvement.

对于我来说,我的大部分工作,到目前为止小到中等规模的项目,我公司从VS08迁移到VS10 soonish。我应该怎么看?还是真的,我应该花时间学习EF4.0还是会被时间更值得花看NHibernate的? (但是,回到主题,我真的更感兴趣的是LINQ2SQL - EF)

For me, most of my work so far are small to medium sized projects, and my company is migrating from VS08 to VS10 soonish. What should I be looking at? Or really, should I spend the time studying EF4.0 or would it be time more well spent looking at nHibernate? (But back on topic, I'm really more interested in Linq2Sql - EF.)

最后,我目前使用entlib /团结,这框架是依赖/政策注入?

Lastly, I am currently using entlib / unity, which framework is more friendly for dependency/policy injection?

在此先感谢。

推荐答案

下面是一些原因,实体框架(V4)是更好的:

Here are some reasons why Entity Framework (v4) is better:

1 - L2SQL本质的过时

1 - L2SQL is essentially obsolete

2 - L2SQL不支持POCO的映射,EF确实

2 - L2SQL does not support POCO mapping, EF does.

3 - EF具有更大的灵活性(code首先,模型首先,数据库第一)。 L2SQL只有1。

3 - EF has more flexibility (code first, model first, database first). L2SQL has only 1.

4 - EF具有存储过程的支持 - > POCO映射

4 - EF has support for SPROC -> POCO mapping

5 - EF具有实体-SQL,让你回到经典的ADO.NET需要时

5 - EF has Entity-SQL, allowing you to go back to classic ADO.NET when required

6 - EF支持继承(TPT,TPH)

6 - EF supports inheritance (TPT, TPH)

7 - EF去手牵手与存储库模式,并通过IQueryable的延迟执行

7 - EF goes hand-in-hand with Repository pattern, and deferred execution via IQueryable

8 - EF组件(对象集,ObjectContext的)很容易mockable并允许DI

8 - EF components (ObjectSet, ObjectContext) are easily mockable and allow for DI

我想不出任何理由的新项目应使用L2SQL。

I cannot think of any reason why new projects should use L2SQL.

也许有人会说好L2SQL非常适用于小型项目,我可以拖放,并用它做。

Some might say "Well L2SQL is good for small projects, i can drag and drop and be done with it".

那么你可以做到这一点与EF4为好,你就会有更多的灵活性/支,从长远来看,如果你决定修改/增加你的项目。所以这不是借口。

Well you can do that with EF4 as well, and you'll have more flexibility/support in the long run if you decide to modify/grow your project. So that is not an excuse.

心连心

这篇关于LINQ2SQL VS EF在.NET Framework 4.0中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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