A lot of people are confused about whether or not they should use LINQ to SQL, because the word on the street is that Microsoft decided to kill it in favor of another ORM stack, the ADO.NET Entity Framework. The truth, however, is that Microsoft has never said they won’t continue to support LINQ to SQL, only that they won’t be investing heavily in advancing the product and adding a lot spiffy new features. I liken the situation with that of Windows Forms versus Windows Presentation Foundation. Windows Forms aren’t going anywhere and will continue to be supported, but Microsoft is not going to invest a whole lot in advancing Windows Forms when WPF is their primary GUI platform.
That is why Damien Guard, a member of the LINQ to SQL / Entity Framework team, posted a list of changes to LINQ to SQL coming with the release of .NET 4.0.
For a lot of situations, LINQ to SQL makes perfect sense. For one thing, it’s a whole lot faster than EF, because it doesn’t have to go through as many query transformation layers. LINQ to Entities starts with an expression tree, that turns into a conceptual command tree, that turns into a store command tree, that turns into native SQL. L2S, on the other hand, starts with an expression tree that’s converted directly into native SQL.
LINQ to SQL is perfectly suited for real-world scenarios, with great support for stored procedures, concurrency, and POCO. I even have a client that uses it to drive their bread-and-butter web application, and they’ve experienced great results with it. EF, on the other hand, will only really be production-ready when version 2 comes out with .NET 4.0.
That said, if you do want to benefit from the tremendous investment Microsoft is making it its data platform, or if you want to be able to use databases other than SQL Server, then Entity Framework is definitely the way to go. Furthermore, EF is more than just an ORM â€“ things like reporting and analysis services will eventually know how to talk to an EF conceptual model.
However, if you have total control over which backend database you will use, and you know that will always be SQL Server, and you want to take advantage of the power, performance and simplicity LINQ to SQL has to offer, then you should not hesitate to use it. It will be around for quite a while â€¦ at least as long as Windows Forms. J