views:

79

answers:

3

I would like to know what are the principal diferences between "ADO.NET Entitiy Data Model" and "Linq to SQL Classes"? What is the best choice to work with?

I couldn't find any document on the internet explaing that and everything I know is that we can use both, "almost", in the same way.

+1  A: 

Linq To Sql is not being actively supported by Microsoft anymore.. They have picked the Entity framework has 'the way for the future'. You can google and verify this.

Here's your friendly neighbourhood SO topic with all the good bits

Update: Hmm.. it seems that MS has taken a step back from the infamous declaration. But the message is still not clear with respect to the future of L2S.

as of .NET 4.0, LINQ to Entities will be the recommended data access solution for LINQ to relational scenarios.

We also want to get your feedback on the key experiences in LINQ to SQL that we need to add in to LINQ to Entities in order to enable the same simple scenarios that brought you to use LINQ to SQL in the first place.

That pretty much reads 'phasing out' to me. I may be guilty of reading between the lines though.. there may be hope after all... behind all the 'on-the-fence' answers
ADO.Net team blog : Update on LINQ to SQL and LINQ to Entities Roadmap
ADO.Net team blog : Clarifying the message on L2S Futures.
http://damieng.com/blog/2008/10/31/linq-to-sql-next-steps

Gishu
Per DamienG, changes to L2S in .NET 4.0 http://damieng.com/blog/2009/06/01/linq-to-sql-changes-in-net-40MS may be favoring EF as their ORM of choice, but they are still supporting and updating L2S, just with fewer resources.
Jarrett Meyer
@Gishu, thanks for pointing this link. So, the only difference between the two choices is "One is less suported by Microsoft"?
Cleiton
Updated post with more text - that may answer your question. Personally I think I'd go with L2S only if it works for the app's current and future needs - as it is today. i.e. I'll not be hosed even if MS takes L2S behind the barn. For everything else.. E2F appears to be safer and relatively future-proof.. (for a while atleast)
Gishu
A: 

EF classes are not persistent-ignorant. They inherit from a base class that adds a unique entity key and change tracker. This can make disconnected environments more of a pain with EF than the object generated by L2S.

Jarrett Meyer
+1  A: 

This is what I can tell from personal experience (which may not be the whole story):

  • The learning curve for LINQ to SQL may be slightly less steep than for ADO.NET Entity Framework. Personally, I also feel that LINQ to SQL is a bit more lightweight.
  • Both frameworks are getting updated in the next version of the .NET framework (version 4).
  • If you include the features for .NET 4 then Entity Framework appear to be the more feature rich framework. Microsoft seems also very commited to this framework.
  • Visual Studio has quite strong support for both frameworks. For instance, if you create an ADO.NET Data Service in your project it will discover both your LINQ to SQL and Entity Framework classes.
  • Entity classes in the Entity Framework are derived from a specific base class in the Entity Framework. Some may consider this a showstopper for using the Entity Framework.

I find both frameworks surprisingly easy to use and I would suggest anybody interested in these technologies to play around with them. Create a .NET project of choice in Visual Studio and add both LINQ to SQL classes and an Entity Framework model connected to whatever database you have access to. Then try out both frameworks by doing things like CRUD operations etc.

Martin Liversage