In a new project between L2S and EF, I propose EF (consider Entity Framework version 4.0 or higher, DO NOT use earlier releases of EF).
While Linq to SQL is a mapping of a class to a table, EF 4 is a complete Object Relational Mapping (ORM) tool with various mapping scripts.
With EF, you have a lot of flexibility:
- Database First Approach
- Model First Approach
- Code First Approach
and strong LINQ provider integration.
Group testing with Linq2SQL is a nightmare. With EF, you have the POCO (Plain Old CLR Object) classes out of the box. In L2S, an entity class is closely related to the L2S namespace.
EF can also help you with domain-driven scripting scenarios.
Microsoft is now considering EF's first database access method, and it is the base for other services, such as RIA services or MVC database databases.
LinqToSql is now the first database access methodology only in Windows Phone scripts.
source share