Dispelling some urban legends about LINQ to SQL

Scott has a great post where he dispels the following two myths about using LINQ to SQL.

  • LINQ to SQL requires you to start with a database schema.
  • LINQ to SQL requires your classes to implement INotifyPropertyChanged and use EntitySet<T> for any associated collections.

Looking at the post I think he also added in dispelling a third legend, though he didn’t explicitly call it out.

  • LINQ to SQL requires you to use custom attributes in your code and cannot work with a simple poco.  (In other words, LINQ to SQL supports persistance ignorance!)

Personally I have not used LINQ to SQL yet, though I do intend to play with it at some point. I know I have talked to many folks (including friends at Thoughtworks) and I have heard it far easier to grok and use than some other Entity frameworks :)

On the intuitiveness said, I am sold. It took me about five minutes of looking at sample code to understand how to use it.

Thanks for this post Scott!

This entry was posted in LINQ. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://dotnet.kapenilattex.com Jon Limjap


    Do you have a link somewhere illustrating how LINQ to SQL can be used with POCOs?

  • http://graysmatter.codivation.com Justice~!

    Yeah, LINQ to SQL is okay if your domain is *VERY* basic. According to the post you linked, if you’re not using IPropertyChanged and EntitySet you’re writing your own lazy loading scheme! Um…=)

  • http://jimmybogard.lostechies.com Jimmy Bogard

    Just write real big:

    LINQ to SQL supports Persistence Ignorance!

    36pt font, bold, Comic Sans (for effect)