views:

261

answers:

5

I'm just starting with the Microsoft stack doing a web site in ASP.Net MVC and so far using LINQ to SQL. Should I consider LINQ to Entities? Does it have anything special to offer? If so, what?

+1  A: 

Here is an article describing the differences between the two:

http://dotnetaddict.dotnetdevelopersjournal.com/adoef_vs_linqsql.htm

Kevin
interesting find.
John Boker
+1  A: 

here is a little comparison of the two, there are pros and cons to both.

http://dotnetaddict.dotnetdevelopersjournal.com/adoef_vs_linqsql.htm

John Boker
A: 

First, Linq to entity offer many to many functionnality

Second, Microsoft would put more time into it

and I'm sure many other good reason

Fredou
+4  A: 

I have been investigating this exact thing myself.

Here's my finding in a nutshell

LINQ to SQL

Advantages

  • Incredibly easy to use

Disadvantages

  • Cannot update the diagram from the database, you have to delete your class and then drag it back onto the diagram from the DB. This is a real pain if you modified the diagram at all.

  • Not actively being developed any more (they will develop Entity Framework instead).

Entity Framework

Advantages

Disadvantages

  • Complicated and a lot less intuitive

More comparison con be found on: LINQ to Entities vs. LINQ to SQL - What should I use and when?

Conclusion

I personally decided to go down the route of using the Entity Framework. I bought a book and have read the online material and I am very impressed with it. It took a little extra effort to learn, but the benefits really are great :-)

DoctaJonez
It doesn't support POCO - that's why I'm not going to touch it.
Arnis L.
L2S also has the advantage of being pretty damn fast, almost as fast as native ADO.NET when using compiled queries. It is also much more light weight than EF.For small projects with simple requirements I would probably use L2S. Also, L2S is good enough to drive StackOverflow.EF version 4 do look very interesting though.
Egil Hansen
A: 

Although LINQ to SQL isn't going to go away, Microsoft is betting on LINQ to Entities. For that reason, I would go with LINQ to Entities.

The ADO.NET Team Blog has more information on the issue:

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

http://blogs.msdn.com/adonet/archive/2008/10/31/clarifying-the-message-on-l2s-futures.aspx

I've listed these posts chronologically, but be sure to read at least the last one - it's actually the most important one.

Mark Seemann