And the winner is… LINQ to Entities and the ADO.NET Entity Framework

In 2001 we first demonstrated Object Relational Mapping (ORM) technology for .NET – ObjectSpaces. However it has taken 6+ years to get to the point where we have released an ORM. Actually we released two.

  • The release of Visual Studio 2008 in November 2007 gave us our first shipping ORM – LINQ to SQL.
  • The release of Visual Studio 2008 SP1 in August 2008 gave us our second shipping ORM – LINQ to Entities or more specifically, the ADO.NET Entity Framework.

Which reminds me of waiting for a bus. You wait and wait and wait and then finally two come at once! Anyway – I digress.

Choice can be a great thing but it was pretty obvious that having two ORM technologies from one supplier was causing a lot of confusion amongst Windows developers keen to benefit from using an ORM on their projects. I have previously discussed how to choose between these two technologies but things have got much clearer over the last few days.

Last week Tim (Program Manager on the team) posted an update on the roadmap. My summary in one line would be:

  • The Entity Framework (v2) will be the recommended way of using an ORM in Visual Studio 2010 and .NET 4.0. LINQ to SQL will not.

There are clearly some implications that come out of this. I will have a stab at them in Q&A form. This is not an official Q&A – but hopefully is a helpful Q&A.

  • Is this good news? I think so. In this case choice was not helping us get the job done.
  • Will Entity Framework v2 include all the great stuff from LINQ to SQL v1 which was missing from EF v1? I don’t know about “all” but the clear intention is to make EF v2 exhibit the best qualities of LINQ to SQL whilst also maintaining the power and flexibility of EF v1 (support any RDBMS, complex mappings etc)
  • I have a huge investment in LINQ to SQL, should I be worried? Nope. If LINQ to SQL matches what you are trying to achieve then great. We have not stopped development on LINQ to SQL, rather we have made a clear statement that most of our investment in .NET 4.0 will be in the Entity Framework and not in LINQ to SQL.
  • I am about to start using one of these ORMs. Which should I now use? I think my previous post still broadly holds – but IMHO, if you have not yet started using LINQ to SQL then I would advise you went with EF v1.
  • Where can I find out more about EF v2? There was a session on EF v2 during PDC and there is also a blog discussing v2 features.
  • How can I migrate my LINQ to SQL code to LINQ to Entities? The team have started to blog out details of the differences. Expect more in the future.
  • Should I migrate my LINQ to SQL code to LINQ to Entities? Probably not :-) If you are happily using LINQ to SQL then the announcement last week should not worry you.
  • Can I use both LINQ to SQL and LINQ to Entities in the same application? Yep. You could have 100 screens implemented using LINQ to SQL and write the 101st screen using LINQ to Entities.
  • Eric – are you spending any more time on LINQ to SQL? Nope. I decided a few months back that a technology only focused on SQL Server was not where I wanted to invest time as I have traditionally worked with companies targeting many RDBMS.