I work on a project and want to use an ORM. What should I use: Linq to Sql or Entity Framework? Linq to Sql provides more opportunities, as I see, for example support for enumeration types. However, also it is said that, Linq to Sql was for playing and learning for Linq and future strategy of Microsoft lies on Entity Framework. So which one should I use?
-
So we can say that StackOverflow is product of playing and learning, because it uses Linq to Sql:) – LukLed Mar 09 '10 at 00:40
-
:D:D not exactly. I don't know but people say, linq to sql was for playing and learning :d:d but when people start to use it heavily MS changed its strategy and supported it. Now Linq to Sql is used more than Entity framework http://www.hanselman.com/blog/content/binary/WindowsLiveWriter/3cd0a973d675_9B20/image_thumb.png – erasmus Mar 09 '10 at 07:04
5 Answers
As I understand it, support for LINQ to SQL isn't going anywhere, but most of the resources for ongoing development will be devoted to LINQ to Entities. I think you're safe going whichever direction looks like the better choice. If it's LINQ to SQL, go for it as long as it has everything you need- don't count on new features.

- 34,502
- 9
- 78
- 118
If you are deciding between those 2, and can use VS2010, definitely go with Entity Framework 4 now that is properly supports lazy loading, POCO objects, and code only models.

- 51,465
- 22
- 112
- 128
There's a stackoverflow post here that talks about the differences between the two.
What's interesting is that Zack Peterson's answer where he posted a link to article which posses the question "Is Linq to SQL truly dead?" Good fyi article.
But if you're after an ORM, have you looked at NHibernate or SubSonic? There are definately a few good non-MS ORMs out there.
Entity Framework is feature rich and being aggressively enhanced and promoted by Microsoft.
Linq To Sql is feature poor and not being promoted by Microsoft.
Linq To Sql does have some features that Entity Framework (v4) does not.
The risks of using Linq To Sql on a project are much higher than the risks of using EF v4, but you can choose either option.
As far as EF v1/v3.5, try to avoid it (but it's likely to be much easier to upgrade from EF 3.5 to EF 4 than from L2S to EF 4).

- 12,331
- 5
- 38
- 40
You should try PLINQO (http://www.plinqo.com). It's LINQ to SQL with a TON of improvements. Maybe someday EF will not suck. :-)

- 961
- 8
- 20