EF vs. Linq2Sql

EF vs. Linq2Sql

Old forum URL: forums.lhotka.net/forums/t/7255.aspx


Pieter posted on Friday, July 10, 2009

Hi All,

This has probably already been discussed. But what would your recommendation be when starting a new CSLA project, that would need to be maintained for years to come? Should we use Entity Framework or Linq2Sql for our data layer?

I liked using Linq2Sql but after all the crazy talk from MS about dropping it for EF, I'm not so sure.

Thanks in advance!

Vinodonly replied on Friday, July 10, 2009

It's safer and better to stick with what M$ is supporting..

They will suport what they want to support. We have already seen many cases in past like VB6, Visual FoxPro etc..

This is just my opinion..

RockfordLhotka replied on Friday, July 10, 2009

From everything I can see, LINQ to SQL is in the same category as Windows Forms, in that it will be "supported for some time". Which is not inspiring, and is the category that should cause people to include migration to something else in their strategic planning.

From everything I can see, EF is at the center of most data access strategies. Other products, tools and tooling are being designed to work with EF. Which is inspiring, because it means Microsoft itself is relying on the continued evolution and enhancement of EF. Usually this is a good indication of a technology that's worth using in our applications.

But at the end of the day, raw ADO.NET is the only thing you know will remain consistent over a very long period of time. It hasn't changed in a meaningful way since the dawn of .NET. And arguably it is almost the same model as the low-level ADO model from 1997, so it has been pretty consistent for 12+ years.

So if you want real long-term consistency I think the answer is clear. If you want the evolving and supported abstraction layer EF appears to be the front-runner. But abstraction layers never seem to last longer than about 5 years (the DataSet is the best ever for longevity), so when using any abstraction layer you must be prepared for it to have a limited lifespan.

Pieter replied on Saturday, July 11, 2009

Excellent answer.

Thank you Rocky.

Copyright (c) Marimer LLC