LINQ to SQL Add and Delete methods renamed

Now Visual Studio 2008 has been released, I thought I’d look at the new LINQ functionality. I followed ScottGu’s introduction tutorials, but came across a problem.  hopefully this post will save others some time!

ScottGu wrote his LINQ tutorials based on the Beta2 release of .NET 3.5. Between Beta2 and the final RTM, Microsoft renamed several methods:

  • Add is now InsertOnSubmit
  • AddAll is now InsertAllOnSubmit
  • Remove is now DeleteOnSubmit
  • RemoveAll is now DeleteAllOnSubmit

So when I followed Scott’s 3rd tutorial, I thought the methods were missing.

Of course, if you know where to look, this is all documented in the Linq to SQL Beta2 to RTM breaking changes document. But that doesn’t help the huge number of online tutorials already published with the Beta2 naming convention.

Tags:

5 Responses to “LINQ to SQL Add and Delete methods renamed”

  1. ersan Says:

    so much thanx for this post this is very helpful for me.

  2. vamshi chilukuri Says:

    Thank you for this!!!! it was very helpful for me..

  3. Dennis Says:

    You saved my life ;)

  4. gkephorus Says:

    Great, thanks!

  5. ME Says:

    Thanks :D

Leave a Reply