96

Just when I make friends with LINQ to SQL, it appears as though MS is pulling the rug out from under it.

http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx

From my little bit of research, EF is way overkill for simple work. But after this announcement is there a point in continuing to use LINQ to SQL?

Beyond the future for LINQ to SQL, doesn't this just generally send a bad signal? Given the speed with which MS is throwing bits against the wall, is it rational to use any of the new bits early? (and that's being kind, it's hardly early for LINQ to SQL!).

For my LINQ to SQL work, I think I'm headed to SubSonic!

Update: A couple of new opinions:

http://ayende.com/Blog/archive/2008/10/31/microsoft-kills-linq-to-sql.aspx

http://codebetter.com/blogs/david.hayden/archive/2008/10/31/linq-to-sql-is-dead-read-between-the-lines.aspx

abatishchev
  • 98,240
  • 88
  • 296
  • 433
rp.
  • 17,483
  • 12
  • 63
  • 79
  • Nothing in that announcement said anything about LINQ or LINQ to SQL going away...? – Codewerks Oct 31 '08 at 05:58
  • 5
    @AugustLights I think what the announcement says is that "we'll not remove LINQ to SQL, but we are so going to totally ignore it over EF" – Jon Limjap Oct 31 '08 at 07:51
  • Jon--That's the way I read it. The announcement said, "...the Entity Framework will be our recommended data access solution for LINQ to relational scenarios." That translates to goodbye, LINQ to SQL. – rp. Oct 31 '08 at 16:03
  • Can anyone tell me where the indication that LINQ to SQL is dead is? The linked post doesn't seem to say this, only that it won't be the preferred solution. – BlackWasp Oct 31 '08 at 18:17
  • 4
    MFC is not dead, its just not the preferred solution. Do you still code MFC? VB6 is still supported, do you code that? Its always been this way, MS does what it wants, not what you want. – gbjbaanb Oct 31 '08 at 22:03
  • BlackWasp, I wonder the same! Nowhere in the article I read Linq2SQL is dead. Makes me wonder what all the fuss is around? – Sam Dec 09 '08 at 12:04
  • Well, it's not really DOA, unfortunately. However, I think there are a myriad of better options. I think EF is the more "DOA" technology. – BobbyShaftoe Jan 01 '09 at 08:36
  • 1
    @rp: What did you meant under DOA - `Dead or Alive` or `Dead on arrival`? – abatishchev Oct 24 '10 at 09:35
  • not too long ago, Microsoft went through all the trouble to make [updated Linq-to-SQL documentation](https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/), so not only is this not going away, it still seems like a really good option. – NH. Sep 15 '17 at 22:34
  • Updated docs maybe but that's for .NET 3.5. It's dead, Jim, it's dead. – rp. Sep 15 '17 at 22:41

16 Answers16

65

1) They can't "kill" Linq-to-SQL as it is already part of the .net framework. What they can do is stop adding features to it. That doesn't prevent the thousands of developers out there that are already using L2S from extending it and improving it. Some core areas are tricky to touch but they're solid already and the missing designer features can easily be bolted on.

2) One of the PDC EF sessions show that they have learnt a couple of lessons from the EFv1 fiasco and they are now copy-and-pasting a lot of the goodies from L2S into EF and pretending it is new EF stuff. In other words, L2S version two has just been "relabelled" EF.

3) LINQ as such (Language Integrated Query) is the best thing since sliced ice-cream and it can be used with a lot of other things than L2S (Linq to objects, Linq to entities, Linq to XML, Linq-to-anything). So the DP group's attempt to force [the vast masses of] L2S adopters over to [the less popular and currently flawed] Entity Framework is no reason to not learn Linq.

Also see this thread (which is what I believe partly triggered Tim's blog post): http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=4061922&SiteID=1

Update 1: The Dec 2008 issue of Visual Studio Magazine cover story by Roger Jennings is a good read on the topic, with some L2S vs EF comparisons: http://visualstudiomagazine.com/features/article.aspx?editorialsid=2583

Update 2: Anders Hejlsberg was quoted in Redmond Developer News as saying "LINQ to SQL is not dead. I can assure you, it is not dead. Nothing ever goes away. We have never done that and we never will."

http://reddevnews.com/blogs/weblog.aspx?blog=3016

KristoferA
  • 12,287
  • 1
  • 40
  • 62
  • 14
    The creators of StackOverflow adopted Linq to SQL as their ORM of choice. Apparently they decided the benefits outweighed the perils. – Robert Harvey Jul 31 '09 at 17:09
  • Is this still true? I heard that StackOverflow moved away from L2S but can't seem to find this information. – Aaron Jun 21 '12 at 14:16
  • 2
    @Aaron, yes, they use hand-written SQL with their own micro-ORM called Dapper. They might still use LINQ-to-SQL on the less popular sections of the site. – CMircea Aug 08 '12 at 21:12
28

There's an ambiguity to your question that needs to be resolved.

LINQ != LINQ to SQL

There are a whole bunch of LINQ technologies and providers:

  • Linq to SQL;
  • Linq to Entities;
  • Linq to Objects;
  • Linq to XML;

... and those are just the ones from Microsoft. There are non-MS providers too, including NHibernate.

The blog post you linked talks only about Linq to SQL.

The key advantage to LINQ is that you can learn and use one query syntax and reuse it across multiple technologies.

Given this, I'd suggest that any perceived lack of a future for "Linq To SQL" is irrelevant, as skills you gain in writing LINQ Queries will be transferrable to other tools in the future.

Bevan
  • 43,618
  • 10
  • 81
  • 133
  • LINQ 2 SQL syntax is similar enough to Entity Framework that you can walk between the two pretty easily. – Jason Short Oct 31 '08 at 13:25
  • His question is still valid, though, as the actual implementation of LINQ to SQL has some specific advantages working against SQL Server. – Tor Haugen Jan 30 '09 at 02:21
21

We are not killing LINQ to SQL. We are optimizing for EF, but LINQ to SQL is definitely not being killed off :)

- Scott / Microsoft.

Scott
  • 1,978
  • 1
  • 16
  • 36
  • Lol. this cracks me up. did you have to get approval from Microsoft to make this public statement? :p – Kellen Stuart Oct 18 '19 at 21:21
  • eh? in 2009 that was a message the team in question screwd up so i had to fix it... as the product manager of .net :D – Scott Oct 21 '19 at 14:59
13

Not only should you learn Linq (System.Linq.Enumerable and System.Linq.Queryable), you will need to learn the programming language enhancements for your .net language.

In C# 3.0 these include:

  • Extension methods (static methods with the this keyword on first parameter)
  • Compiler inferred types (var)
  • Lambda syntax (which generates an anonymous method or a Expression depending on context)
  • Initializers
  • Property default implementation (a shorthand)

Read more here.


In VB 9.0 there's some inline XML magic, and many other things (many are similar to the above list for C#).

Read more here.

Amy B
  • 108,202
  • 21
  • 135
  • 185
  • Wow, I must have been having a really literal day. Only with a really strict out-of-context interpretation of the sentence that is the question - does my answer even make sense. – Amy B Jan 29 '09 at 02:24
  • @David B, yea.. I was like, this is an ok answer, I just don't see how it answers this question. lol – mmcdole Apr 26 '09 at 16:12
  • 1
    It keeps getting upvotes. I guess some people just need to see the information in the links... If you liked this answer, you might like my better answer over here: http://stackoverflow.com/questions/471502/what-is-linq/471592#471592 – Amy B May 01 '09 at 18:11
8

I honestly do not understand where in that article you read that link2sql is dead.

In the blog post you linked to it says:

We are listening to customers regarding LINQ to SQL and will continue to evolve the product based on feedback we receive from the community as well.

For me this reads like LINQ to SQL will be developed and supported in future. I wonder why you think it is dead?

Sam
  • 28,421
  • 49
  • 167
  • 247
7

Granted, I think that the choice between LINQ to SQL, LINQ to Entities and LINQ to [insert 3rd Party ORM] here provides a perfectly healthy eco-system of data access layer methodologies that a software developer can choose from. Third party providers like NHibernate, LLBLGen and even Subsonic (not sure if they're going to offer LINQ providers) will definitely make the competition better and more interesting.

That being said, it will be totally sad for Microsoft to abandon LINQ to SQL, especially since it does have a good following -- even StackOverflow is built on it.

Jon Limjap
  • 94,284
  • 15
  • 101
  • 152
6

Interesting blog post about it. And some related information on Stackoverflow posts.

The basic gist appears to be comments made on the ado.net blog that state the Entity Framework is the only thing getting major developer time for Visual Studio 2010 and Dot Net 4.

My response is - DUH. We have all known this. Microsoft said publicly back at the PDC 2007 that LINQ to SQL was a short term release for SQL Server because there was no other LINQ story to SQL Server. It only works with SQL Server. You cannot write a LINQ to SQL provider - there is no model for it. It was a one off technology, not extensible.

The Entity Framework is the ONLY way from Microsoft to build a LINQ Provider. The Entity Framework has turned out to be quite contreversial, but I think that is partly due to the fact that LINQ to SQL has a better programmer experience today. Entity Framework will catch and surpass LINQ to SQL because it is the ORM/Mapping tool of the future from Microsoft.

EDIT - I just did a slightly more detailed write up about this on my blog

EDIT2 - IQueryable Provider - is NOT the same thing as a LINQ to SQL provider. You can write your own IQueryable Provider for anything you like. You get no designer support or model generation. There is no gui designer model that I know of for tying into LINQ to SQL model generation.

Community
  • 1
  • 1
Jason Short
  • 5,205
  • 1
  • 28
  • 45
  • 1
    Re.: "You cannot write a LINQ to SQL provider - there is no model for it." Well, there _is_. It is just that they decided to make the necessary members private last-minute to give EF an edge. See http://blogs.msdn.com/mattwar/archive/2007/05/31/the-origin-of-linq-to-sql.aspx – KristoferA Oct 31 '08 at 13:56
  • 1
    Sorry, the previous link should have been http://blogs.msdn.com/mattwar/archive/2008/05/04/mocks-nix-an-extensible-linq-to-sql-datacontext.aspx – KristoferA Oct 31 '08 at 13:59
  • Thanks - had not read that post. I did know that there was an API internally, but didn't know if that had ever been released public knowledge. – Jason Short Oct 31 '08 at 14:24
  • 1
    The same blog ( http://blogs.msdn.com/mattwar/ ) also has a complete article seriess (with samples) on how to write providers, _and_ a pluggable downloadable L2S provider that you may find useful. – KristoferA Oct 31 '08 at 15:25
  • Doesn't matter if you can hack it - it is NOT officially supported by MS. You have NO VSIP integration for it. You cannot get a logo for you app... – Jason Short Oct 31 '08 at 21:20
  • After reading through the blog - he is talking about writing an IQueryable Provider. That is not the same thing as Linq to SQL. – Jason Short Oct 31 '08 at 21:22
5

I guess I don't really see the problem here. From the article you've linked:

We are listening to customers regarding LINQ to SQL and will continue to evolve the product based on feedback we receive from the community as well.

Am I missing something? What gives the impression of LINQ to SQL being dead on arrival?

Gabriel Isenberg
  • 25,869
  • 4
  • 37
  • 58
4

Anyone remember VB6? Whether you personally loathe it or love it, Microsoft sold millions of copies, and businesses spent millions of dollars writing millions of lines of VB6. What happened next?

  • Well, Microsoft do still support VB6 (kind of - not the IDE).
  • And Microsoft still say that they are listening to VB6 customers even now (in September 09).
  • But are VB6 customers happy? Not since 2002, 4 years after VB6 launched.
  • Why not? The upgrade paths for your code investment to the replacement technology, VB.Net, are expensive.

So just consider that lesson. To me, it seems LinqToSQL support will be rather grudging. They are obliged to support it because it is in the current .NET framework. But will it be in .NET 5, 6, 7...? Just think about how much that matters to you (for all I know, it doesn't matter to you at all).

Community
  • 1
  • 1
MarkJ
  • 30,070
  • 5
  • 68
  • 111
  • for me the best is pure ado.net with OracleConnection and SqlConnection because this providers and System.Data.DataSet never die. Is the base of Tabular data. Personal i like EF but professional DataSet continue to be a standard. – pedrofernandes Dec 17 '12 at 21:42
4

Scott Guthrie told me they would not kill LINQ to SQL:

Post at LINQDev.com

Joe Rattz
  • 319
  • 1
  • 5
  • 13
3

Maybe you should not bother learning Linq to SQL, but there's still the Entities Linq that they will keep.

korro
  • 1,577
  • 13
  • 11
  • 1
    The current EF approach has some serious issues, not least the enforced base-class. I would expect EFvNext to look quite different in places; until then, I would recommend using the simplest option: L2S - or nHibernate ;-p – Marc Gravell Oct 31 '08 at 13:07
  • 1
    Once you've got your head around LINQ I would suggest that "learning" LINQ to SQL is pretty trivial. It's just a case of adding a LINQ to SQL classes item to your project and drag-dropping a few tables onto the designer. – Richard Ev Nov 27 '08 at 13:17
3

See also http://ayende.com/Blog/archive/2008/10/31/microsoft-kills-linq-to-sql.aspx and the the comments there

loraderon
  • 4,658
  • 2
  • 32
  • 35
3

Its obvious that 2 ORMs is one to many in Microsoft's toolbox, but to me it seems to be the wrong framework has been chosen for all the wrong reasons. The fact that the C# team did the job that the ADO.NET team was supposed to do in lot shorter time and did the job way better is tough to swallow for the ado.net team. Not that I know the internal workings of the 2 frameworks but I think it would be a lot faster to upgrade the shortcomings linq2sql has to the entity framework.

There seem to be too much politics involved and I think this is really going to hurt the asp.net reputation, since I have no trust in that Entity framework will give us a equally user friendly experience as Linq2sql. The ado.net team could also learn some communication skills from the asp.net mvc team as the clarifications on the problem is at best vague.

It would be fun learning what Scott Gu and his MVC team stands here as most of their examples are using Linq2Sql.

Will Dean
  • 39,055
  • 11
  • 90
  • 118
terjetyl
  • 9,497
  • 4
  • 54
  • 72
2

It was always a bit weird that with Linq 2 Sql and Entity Framework there was large areas of overlap. I think the only reason L2S only ever made it into the .NET 3.5 release was because there was a large doubt that EF would ever see the light of day. Now that EF1 is out, all be it a very rough v1, there was no need for L2S anymore.

Craig
  • 36,306
  • 34
  • 114
  • 197
2

(no, StingyJack, LINQ to SQL does not use the entity framework)

Anyway, I wouldn't worry. Tim states that they are listening to customers regarding LINQ to SQL. Judging from the enthusiasm I've seen for L2S, the customers (that's us) will speak their minds.

And, as KristoferA points out, they can't actually 'kill' L2S, only freeze it. And L2S, once polished, doesn't really require much further development. With the L2S provider in place, any advances in LINQ should be available in L2S as well. So the choice will still be ours.

Tor Haugen
  • 19,509
  • 9
  • 45
  • 63
  • Well, they could kill it by not including it in Dot Net 4 which is supposed to be a side by side install. Which would mean dot net 4 apps would not have access to it without installing 3.5SP1 on the same machine - don't know if that is true or not. – Jason Short Oct 31 '08 at 14:25
  • Anyone remember VB6? Microsoft do still support VB6 (kind of). They still say that they are listening to VB6 customers even now. But are we happy? No. The upgrade paths to get our code to the replacement technology, VB.Net, are expensive. So just consider that lesson: and do think about whether LinqToSQL will be in .NET 4, 5, 6... and how much that matters to you. – MarkJ Nov 14 '09 at 17:17
0

The next version of Windows Phone 7, codename Mango, includes a SQL Server Compact Edition accessible via Linq to SQL http://jesseliberty.com/2011/05/10/coming-in-mangosql-server-ce/

Bruno Martinez
  • 2,850
  • 2
  • 39
  • 47