Sunday, March 8, 2009

LINQ to SQL vs. LINQ to Entities

There's a great paper on MSDN that describes the similarities and differences in LINQ to SQL and LINQ to Entities from the Entity Framework. 

A lot of people are really fired up about the simplicity that LINQ brings to the table.  What is confusing is how LINQ to SQL conflicts and overlaps with what LINQ to Entities offers.  From the article referenced above, the key takeaways are summarized below.

LINQ to SQL is good when your solution is targeted classes are going to be targeted at SQL Server and you have a 1:1 relationship between the domain model and database schema.

Use LINQ to Entities as an ORM solution where your classes may be 1:1 with the database or may have a very different structure from the database schema and targets.  LINQ to Entities will also good for 3rd party database solutions. 





Professional ADO.NET 3.5 with LINQ and the Entity Framework (Wrox Programmer to Programmer)

Pro LINQ Object Relational Mapping in C# 2008

No comments:

Post a Comment