Im new to development for the windows server platform. Can someone tell me the difference between Linq to SQL and EF4? I need some help choosing the right technology.
Asked
Active
Viewed 1,424 times
3
-
1IMHO if you are looking for the right technology then you should checkout Nhibernate and Fluent Nhibernate, specially if you are into domain driven design. – ryudice Dec 06 '10 at 23:42
-
1but they are not supported by MS? right? – Joanne Dec 06 '10 at 23:49
-
No it's not supported by MS, but sometimes that is an advantage instead of a disadvantage. – ryudice Dec 07 '10 at 00:01
-
1possible duplicate of [Linq2SQL vs EF in .net Framework 4.0](http://stackoverflow.com/questions/4329991/linq2sql-vs-ef-in-net-framework-4-0) – Agent_9191 Dec 07 '10 at 00:50
-
As above: Entity Framework 4 vs LINQ to SQL http://stackoverflow.com/questions/4051621/entity-framework-4-vs-linq-to-sql-for-small-or-medium-size-apps-working-with-s/4136729#4136729 – Doro Oct 28 '13 at 21:25
2 Answers
5
L2SQL is obsolete deprecated. Whilst it will be supported, no future changes are planned.
For this reason alone (since your just starting out), use Entity Framework 4.
If you want a comparison of the two, check out my answer here.
This question is highly subjective though, and might be closed - as there is a war between the "EFers" and the "NHibernaters".
-
-
Is there anything that I can do with Linq to sql that I can't with EF4? – Joanne Dec 06 '10 at 23:54
-
@Joanne - no. EF built on L2SQL. You should choose either EF4 or NHibernate. I choose EF4 because (when possible) i like to choose MS products (support, consistency, fact it's built on top of .NET). That is however a matter of choice. – RPM1984 Dec 07 '10 at 00:39
-
I have not used NHibernate before, so i cannot comment on the performance of that. EF is fine - as long as you optimize your queries when required. – RPM1984 Dec 07 '10 at 00:58
-
nhibernate can perform better than EF (note the word "can") due to its ability to cache better. Read more comparison here: http://ayende.com/blog/archive/2010/01/05/nhibernate-vs.-entity-framework-4.0.aspx – Chris Conway Dec 07 '10 at 01:34
-
Fair enough, although EF also has "Compiled Queries". (pre-cached execution plans). – RPM1984 Dec 07 '10 at 01:48
-
@Phill - i was referring to support in terms of EF being a MS- product, as opposed to NHibernate which is open source. – RPM1984 Dec 07 '10 at 02:36
-
I don't get your point, if you go EF, and theres a bug in EF, you have to write a work around. If you can't do something, getting support from MS takes weeks to get any sort of good answer. With NHibernate, if theres a bug, you can bet your luck getting the latest trunk will fix it, or you could fix it, support for NH is quick, and there are commercial support options. Support wise... NH > EF. – Phill Dec 07 '10 at 04:22