Entity Framework 6 Beta 1 has shipped. The good news is that among (many) others it contains a few changes to view generation. There is now a public API on the StorageMappingItemCollection type that can return views for a given StorageMappingItemCollection instance. The bad news is that some of the changes we introduced in this area in the Beta version are breaking. This means that views created with the EF6 CodeFirst View Generation T4 Template for C# I created for the EF6 Alpha will no longer work with the Beta version and need to be recreated. The main changes (apart from adding the public API) to view generation in Beta are:
- removing HashOverAllExtentViews – we did not feel we needed it any longer (or maybe we had ever needed it) and not removing it could block some interesting scenarios we might want to enable in the future
- making pre-generated views ignore the order of properties/entities/entity sets etc when checking if views provided by the user match the model – CodeFirst builds the model using reflection and reflection does not guarantee the order in which members will be returned. This caused problems where views generated on one machine sometimes did not work on a different machine even though there were no changes to the code
Because of the above breaking changes I updated the EF6 CodeFirst View Generation T4 Template for C# to work with EF6 Beta 1. Note that the new version uses the new public API for view generation and therefore it requires that your project has a reference to the EntityFramework.dll shipped with EF6 Beta 1. Also, you cannot generate views with the new version and re-use them in an EF6 Alpha project.
Installation steps have not changed comparing to the previous version and you can found them in this post. You shall not have to uninstall the previous version – the new vsix should replace the old one.