Entity Framework 4.0 Resources – documentation links, best blog posts and more
This is one of a series of posts on my preparations for sessions on Azure and ORMs at Software Architect 2009.
[Initual release 22nd Sept 2009]
[Updated 23rd Sept, with links from Julie Lerman]
[Updated 2nd Oct, with slidedeck section]
[Large Update 15th Dec – including PDC09 content, my new posts and plenty of stuff from Julie L, Tony and others]
This is my attempt to pull together all (ok – most) of the improvements in Entity Framework 4.0 and aggregate useful resources against each. It is very much work in progress – but is hopefully already fairly helpful.
Some of the links are to early posts which came out pre VS2010 Beta 1. These should be treated with caution as a lot changed since they were written – but they often start with a good introduction to the topic and hence I felt they were worth including.
General Resources
Documentation
- Updated Entity Framework Documentation for Beta1: MSDN Documentation (far from complete)
- Announcing: Entity Framework Feature CTP 1: After VS2010 Beta 1 shipped, the EF team added 3 new features in a CTP1 just for Entity Framework. The documentation comes as walkthroughs
- Better N-Tier Support with Self Tracking Entities
- POCO (Plain Old CLR Objects) entity code generation via the POCO Template
- Writing only code and having it work with the Entity Framework via Code Only.
- NB: These will ship shortly after VS2010 RTM
Overview blog posts/articles
- What’s New and Cool in Entity Framework 4.0
- Top Ten New Features in Entity Framework 4.0
- What’s New in Entity Framework 4? Part 1: API Changes (Tx julie)
- What’s New in Entity Framework 4, Part 2: Modeling Changes (Nov/Dec 2009)
- Renovations to .NET 4.0’s Entity Framework (Nov 2009)
- Entity Sequel (Dec 2009)
- 5 Steps to having a great time with Entity Framework 4 Beta 2 (Dec 2009)
Team Blogs
- Entity Framework Transparent Design Blog http://blogs.msdn.com/efdesign
- ADO.NET Team blog http://blogs.msdn.com/adonet
- Daniel Simmons http://blogs.msdn.com/dsimmons
- Diego Vega’s blog http://blogs.msdn.com/diego
- Alex’s blog http://blogs.msdn.com/alexj
Community Bloggers
- Julie Lerman, author of Programming Entity Framework http://thedatafarm.com/blog
- Check out EF4 posts http://thedatafarm.com/blog/tags/ef4/
- Roger Jennings, author of ADO.NET 3.5 with LINQ and the Entity Framework
- Entity Framework post aggregation
- Dan Rigsby http://www.danrigsby.com/blog
- Gunnar http://weblogs.asp.net/gunnarpeipman/archive/tags/Entity+Framework/default.aspx
- Tony http://blog.tonysneed.com/
Screencasts and Podcasts
- Julie Lerman Tips and Tricks – includes some EF4 insights http://www.oreillynet.com/pub/e/1412 (60mins)
- 10-4 Episode 15: Model-First Development with the Entity Framework 4.0
- .NET Rocks with Daniel Simmons May 22nd 2009.
- Agile Entity Framework Part 1: POCO Classes NotAtPDC.com, 75 min (Nov 2009)
- Agile Entity Framework Part 2: Repositories & Testing NotAtPDC.com 75 min (Nov 2009)
- Screencast – What’s new in the Entity Data Model Designer in VS2010 20 min. (Oct 2009)
- MSDN Flash Podcast 014 – Entity Framework and ADO.NET Data Services at TechEd Europe 12mins (Dec 2009)
- Entity Framework 4: Part 1 – Simple Model First 10mins (Nov 2009)
- Øredev chit-chat: Dag König and Julia Lerman 15mins (Nov 2009)
- Evolving ADO.NET Entity Framework in .NET 4 and Beyond 55mins (Nov 2009)
Slidedecks
Eric Nelson overview of Impact of ORM and Entity Framework 4 on Architecture
Misc
- A series of Entity Framework Tips. Some are EF 4.0 specific
Improvements to the Tools/Designer
- Now used the T4 template engine for code generation
- You can configure the ADO.NET Entity Data Model Designer to use text templates to generate customized object layer code. For more information, see How to: Customize Object Layer Code Generation.
- Customizing T4 Templates
- Feature CTP Walkthrough: POCO Templates for Entity Framework
- Sneak Peek – Using Code Generation Templates with the Entity Framework 4.0
- Customizing EDM Code Gen in EF4
- T4 Templates in EF4 (Dec 2009)
- Getting Started with Entity Framework 4 – Templated Code Generation (Nov 2009)
- T4 Templates and the answer to life, the universe and everything (Nov 2009)
- Tangible T4 Editor – a life saver (Nov 2009)
- Adding Your Own T4 Templates for EF4 to Visual Studio 2010 (Dec 2009)
- Model-First Development is now possible
- The Create Database Wizard enables you to do conceptual modelling first, and then create a database that supports the model. For more information, see How to: Generate a Database from a Conceptual Model.
- Sneak Preview: Model First in the Entity Framework 4.0
- Model First (Sept 2008)
- Entity Framework 4.0: Generating SQL script from model
- Detailed look by the team at customising Model First generation (Nov 2009)
- Getting Started with Entity Framework 4 – Simple Model First Example (Nov 2009)
- Automatic Pluralization/Singularization is now added including customisation
- The Entity Data Model Wizard and the Update Model Wizard provide the option of using singular or plural forms of Entity, EntitySet, and NavigationProperty names to make application code more readable. For more information, see Choose Your Database Objects Dialog Box (Entity Data Model Wizard) and Choose Your Database Objects Dialog Box (Update Model Wizard).
- Sneak Preview – Pluralization in Entity Framework 4.0
- Entity Framework 4.0: Pluralization – deep look at customising
- The much improved EDM Wizard Pluralization in VS2010
- Pluralization (Dec 2008)
- The designer now surfaces Complex Type support
- The ADO.NET Entity Data Model Designer now supports complex types. For more information, see the following topics:
- Complex Types in the EDM Designer in EF4 and a look at updating complex types in code
- Getting Started with Entity Framework 4 – Complex Types and Entities (Nov 2009)
- Stored procedure mapping is improved significantly
- Checking out one of the new stored procedure features in EF4
- A big step for Stored Procedures in EF4
- Entity Framework 4.0: Scalar and Void Functions
- Automatic Generation of Stored Procedure Return Types
- Using Stored Procedures to load structured data. (Jul 2008)
- Improved control over Entity deletion and search
- The Model Browser window of the ADO.NET Entity Data Model Designer enables you to delete objects from the storage model and to search the conceptual and storage models for a specified string. For more information, see Model Browser Window and How to: Delete Objects from the Storage Model.
- More Designer Improvements – Deleting Entities from the model and from the store schema
- Misc:
- EF4 – New Properties for Entity Properties?
- Making it easier in the designer to do EF Table Splitting – The Opposite of Entity Splitting
Persistence Ignorance
You can use your own custom data classes together with your data model without making any modifications to the data classes themselves. This means that you can use “plain old” CLR objects (POCO), such as existing domain objects, with your Entity Framework application. For more information, see Persistence Ignorant Objects (Entity Framework).
- No need to inherit from EntityObject
- No need to implement any EF interface
- No metadata attributes
- By-convention mapping between model and POCOs
- Any ICollection<T> for collections and object references for relationships
- Snapshot change detection
- POCO in Entity Framework : Part 1 – The Experience
- POCO in Entity Framework : Part 2 – Complex Types, Deferred Loading and Explicit Loading
- POCO in Entity Framework : Part 3 – Change Tracking with POCO
- Using Repository and Unit of Work patterns with Entity Framework 4.0
- Why not use POCO always?
- Sneak Preview: Persistence Ignorance and POCO in Entity Framework 4.0
And from the community:
- First look http://mosesofegypt.net/post/Entity-Framework-4-Persistence-Ignorance-First-Look.aspx
- Entity Framework 4.0: POCOs and table-per-type inheritance mapping
- Entity Framework 4.0: How to use POCOs
- Entity Framework 4.0 – How To POCO
- A Simple Mapping (Dec 2009)
Code-only
In NET 4.0 Beta 1 we introduced Model-First which allowed you to begin by creating an entity data model, then use it to create an empty database and classes. The subsequent CTP introduced Code Only.
- Begin by writing your classes, use them to create the database. There are no metadata artifacts at runtime
- Code Only introduction before CTP 1.
- Code Only Enhancements details what to expect in the release after CTP 1.
- Code Only – Further Enhancements (Oct 2009)
And from the community:
Code Only looking good (Dec 2009)
Deferred Loading of Related Objects (aka Lazy Loading)
With deferred loading, also known as lazy loading, related objects are automatically loaded from the data source when you access a navigation property. For more information, see Shaping Query Results (Entity Framework).
- Sneak Preview: Deferred Loading in Entity Framework 4.0
- A Look at Lazy Loading in EF4
- Getting Started with Entity Framework 4 – Lazy Loading (Nov 2009)
Foreign Key associations
Foreign Keys are now surfaced.
- An FK property can define an association and be part of the entity at the same time
- Concurrency is now shared with the entity
- FKs, EntityReferences, EntityCollections are all kept in sync
- Overlapping composite keys are supported
- Detailed look at Foreign keys by the team (Nov 2009)
- Foreign Keys in the Entity Framework
- Foreign Keys in the Conceptual and Object Models (Oct 2008)
Query Improvements
- Enhanced support of LINQ query operators
- Contains
- DefaultIfEmpty
- Single, SingleOrDefault (in top projection)
- Function Mapping
- EntityFunctions and SqlFunctions
- The EntityFunctions and SqlFunctions classes provide access to canonical and database functions from LINQ to Entities queries. The EdmFunctionAttribute allows a CLR method to serve as a proxy for a function defined in the conceptual model or storage model. For more information, see Calling Functions in LINQ to Entities Queries.
- Model Defined Functions (Jan 2009)
- EF4: Model-Defined Functions Level 1 & 2
- EDM and Store functions exposed in LINQ (Oct 2008)
- ExecuteStoreQuery and Translate
- Not forgetting better support for using Stored Procedures (see Tools section above)
- Important Entity Framework Query Improvements for .NET 4.0
- Improvements to the Generated SQL in .NET 4.0 Beta1
- Variable parameters and SQL Server Query Plan cache
N-Tier
In Beta 1 we added an improved API for reporting changes: ChangeObjectState, ChangeRelationshipState, ApplyOriginalValues. In the CTP we added Self-tracking entities: serialize changes alongside current state in the object graph
- Feature CTP Walkthrough: Self Tracking Entities for Entity Framework
- Sneak Preview: N-Tier development with Entity Framework 4.0
- Self-Tracking Entities in the Entity Framework
- Entity Framework: Anti-Patterns To Avoid In N-Tier Applications
Danny Simmons explores some anti-patterns you should look out for when building n-tier applications with the Entity Framework. - Entity Framework: N-Tier Application Patterns
This article examines n-tier patterns for success and some of the key APIs and issues specific to the Entity Framework. It also provides a sneak peak at features coming in the Microsoft .NET Framework 4 that should make n-tier development significantly easier. - EF 4.0 N-Tier Support: Take 2 (Nov 2009)
- N-Tier Improvements for Entity Framework (Nov 2008)
Improving Testability of the Entity Framework
Unit testing EF v1 is tricky (Check out Julies post on this). Things get a lot better with EF 4.0 thanks to a combination of features:
- POCO – classes that do not depend on the EF can be easier to test
- Data Access Guidance and the Repository pattern – work in progress http://dataguidance.codeplex.com/
- New IObjectSet<T> interface makes it easier to fake an object
- Template based code generation – control the code gen
- LINQ to Entities improvements make LINQ to Entities and LINQ to Objects closer – which can simplify testing
- Sneak Preview: Entity Framework 4.0 Testability Improvements
Wednesday, September 23, 2009 3:16 PM