The Entity Framework team at Microsoft has been extremely busy this past year to get a new version of the Entity Framework out the door. The first release (which shipped last summer with .NET 3.5 SP1) generated a fair amount of criticism, especially because it lacked many features present in LINQ to SQL, such as POCO (Plain Old CLR Objects) support, and required developers to write excessive amounts of code to deal with things like concurrency and n-tier scenarios.
In response, the EF team published an Entity Framework Design Blog, soliciting feedback from the community on critical design decisions. The team has also published a series of posts on new features on the ADO.NET Team Blog. We now have the first CTP of EF4 and the MSDN documentation is online.
EF4 comes with a boat load of features, so many in fact that it\’s hard to know where to begin! To help break them down, I have compiled a top-ten list of EF4 features. These are listed in relative order of importance.
Define your own objects that are completely decoupled from persistence concerns.
Create customized code generation templates (for example, POCO classes).
Load related entities automatically on-demand.
Different options for tracking changes to entities.
Propagate entity changes across service boundaries for batch updates.
The tools fix up entity names in case database tables are in plural form (Northwind!).
Create an entity model and generate the database from it.
Create classes without a model.
Have more control over storage, conceptual and mapping schemas.
Create complex types in your model.
b. Foreign Keys
Optionally include foreign keys in your model.
Call database, conceptual and model-defined functions from L2E queries.
Test-driven development is easier now.
Generated SQL is faster, simpler and easier to read.
Hats off to the EF team for responding to almost all our requests. Mapping multiple stored procedure results to complex entities is still not supported, but there has to be something for the next version.