none
To Entity or Linq?

    Question

  • Please help me understand why LINQ-to-SQL and the ADO.Net Entity framework both exist. They both are object layers over your traditional data store. The LINQ queries work on the LINQ-to-SQL and ADO.Net Entity Framework object models. Comments from staff at Techdays 2010 makes it look like the Entity Framework is the best choice for a long term strategy, and you can use LINQ queries against these object when appropriate. Why use LINQ-To-SQL as your ORM and not the Entity Framework? Why does LINQ-to-SQL exist? Will it die? Thank you in advance.


    Michael Saft
    Thursday, August 18, 2011 4:17 PM

Answers

  • Linq To SQL was written first.  ADO.Net Entity Framework came out later, and was, at least at first, less mature.  This really isn't the case now.

     

    At this point, I'd argue that any new development would be foolish to choose Linq to SQL over EF - EF is more mature, supports a lot more options in terms of development, and is overall a nicer platform that's still being actively developed.  Linq To SQL is being maintained still, but not receiving new development, so I'd argue there is little reason to choose it for new development, but if you have a project using it, it's fine to keep using it for that project.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Proposed as answer by Jesse Houwing Thursday, August 18, 2011 6:29 PM
    • Marked as answer by KindReality Tuesday, August 23, 2011 4:03 PM
    Thursday, August 18, 2011 4:27 PM
    Moderator
  • Microsoft has shifted all development effort towards EF. Linq-2-sql is still supported, but as Reed says, no longer actively developed. Microssoft had hoped that other DB vendors would provide drivers for L2S, but that never happened.

    The official statement is that for prototypes and throw-away projects you should use Linq-2-sql, for any serious development use Entity Framework.

    It might also be good to note that Entity Framework has received a number of out-of-band updates and the current version is 4.1 update 1. And that the evangelism team recommends you use at least version 4.1 and use Code First for all new development and use your code to generate your data model.

    http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx

    http://www.hanselman.com/blog/SimpleCodeFirstWithEntityFramework4MagicUnicornFeatureCTP4.aspx 

    • Proposed as answer by Jesse Houwing Thursday, August 18, 2011 6:29 PM
    • Marked as answer by KindReality Tuesday, August 23, 2011 4:03 PM
    Thursday, August 18, 2011 6:29 PM

All replies

  • Linq To SQL was written first.  ADO.Net Entity Framework came out later, and was, at least at first, less mature.  This really isn't the case now.

     

    At this point, I'd argue that any new development would be foolish to choose Linq to SQL over EF - EF is more mature, supports a lot more options in terms of development, and is overall a nicer platform that's still being actively developed.  Linq To SQL is being maintained still, but not receiving new development, so I'd argue there is little reason to choose it for new development, but if you have a project using it, it's fine to keep using it for that project.


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Proposed as answer by Jesse Houwing Thursday, August 18, 2011 6:29 PM
    • Marked as answer by KindReality Tuesday, August 23, 2011 4:03 PM
    Thursday, August 18, 2011 4:27 PM
    Moderator
  • Microsoft has shifted all development effort towards EF. Linq-2-sql is still supported, but as Reed says, no longer actively developed. Microssoft had hoped that other DB vendors would provide drivers for L2S, but that never happened.

    The official statement is that for prototypes and throw-away projects you should use Linq-2-sql, for any serious development use Entity Framework.

    It might also be good to note that Entity Framework has received a number of out-of-band updates and the current version is 4.1 update 1. And that the evangelism team recommends you use at least version 4.1 and use Code First for all new development and use your code to generate your data model.

    http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx

    http://www.hanselman.com/blog/SimpleCodeFirstWithEntityFramework4MagicUnicornFeatureCTP4.aspx 

    • Proposed as answer by Jesse Houwing Thursday, August 18, 2011 6:29 PM
    • Marked as answer by KindReality Tuesday, August 23, 2011 4:03 PM
    Thursday, August 18, 2011 6:29 PM