First of all: you do not need to use LINQ to use Entity Framework (EF), but it certainly helps. EF is based on something that the EF team calls Entity SQL, so what really happens when using LINQ to Entities is that LINQ expressions are translated into Entity SQL, which again translates into any SQL dialect used by your database (T-SQL for SQL Server).
The pros and cons for EF is a bit of a moot point, since most people don't particularly like EF, but I will try to keep it neutral.
Pros
- Together with LINQ to SQL (L2S), LINQ to Entities (L2E) and EF are currently the best data access APIs that Microsoft offers. Despite all their shortcomings, they are much better than the "traditional" ADO.NET for most scenarios.
- While L2S is simpler, L2E has been flagged as the future Microsoft Data Access API, so if you want to stay in the standard Microsoft API data stream, you should use L2E. It does not look like L2S will see many new developments.
- EF will get a significant increase in features and flexibility in .NET 4
vs
- Working with EF is complicated. It's pretty fragile when it comes to circuit changes, and it's a bitch to update it when the base circuit changes
- EF generated T-SQL is terrible (although this should change in .NET 4)
- Saving Ignorance is not possible (before .NET 4)
- Many LINQ methods are not implemented, so the API is more limited than it looks.
- This is not as flexible an API as you wish.
In short, use it if you can only use what is baked in BCL, or if you are on .NET 4, try; otherwise, there are better alternatives in the form of open source libraries.
source share