I’ve seen some discussion about L2S vs EF4 on Stack Overflow back in April, when VS2010 was launched, namely:
Dump Linq-To-Sql now that Entity Framework 4.0 has been released?
Is Entity Framework worth moving to for a new small app?
Now, after 6 months, presumably people have had more interacting with EF4, so I’m curious of fresh opinions, especially when considering working only with SQL Server.
I’ve used LINQ to SQL a lot, and only played a bit with EF4. I wouldn’t mind jumping in and learning more EF4, I’m not convinced though that it’s worth the extra complexity, if my app is only going to talk to SQL Server.
So, if you had some experience with both, and you were to start a new small or medium-size app today, with a SQL Server back-end, which one would you choose?
And, of course, why…
It depends… 🙂
If you don’t need any of the extra features added by EF, L2S is generally:
EF adds more features such as support for other RDBMSes and more complex mapping than plain 1:1, support for several different types of entity inheritance etc. That comes with a cost:
In short:
only need to support SQL Server, and
your db schema / data model is clean
enough so you don’t need to do more
advanced mapping then L2S is a great
choice. Although it is unlikely that
MSFT will add any new big features
to it, that is not really necessary.
It works great as it is and solves
the problem it is supposed to solve. Lots of apps and websites (including this one) runs fine on L2S.
than SQL Server, or if your db
schema doesn’t match the object
model you want, or you need other
‘bigger’ features from EF then you
should use EF.