A few weeks ago I demo’d how to reverse engineer an existing database using the Entity Framework Power tools Beta 1. A few days ago (9th of April) the EF team released an update to that tool setup with some new features.
You can view the announcement here.
The EF power tools requires EF 4.2 and higher and VS 2010 SP1. They do provide a work around in order to install the power tools to Visual Studio 11.
So what is new in this update.
- First is an update to the reverse engineer code generator. It is now customizable utilizing T4 Templates. If you would like more information on T4 Templating Peter Vogel has a nice write up in the April MSDN and Dustin Davis has a killer series on PluralSight.
- To modify the T4 templates for reverse engineer code first
- Right click the project
- In the contextual menu go to Entity Framework
- Select Customize Reverse Engineer Templates
- Look at the templates located in CodeTemplates\ReverseEngineerCodeFirst
- To modify the T4 templates for reverse engineer code first
- Along with the new T4 templating addition there was also a few bug fixes to the code that was generated. Any issues I personal ran into from this was corrected with one code cleanup sweep by Resharper + style cop.
- The next update in my opinion is huge addition. Generate Views for Database First and Model First. This is because you need an EDMX file in order to access this command. Code First does not have this. Keep reading because they did not forget about those of us that life for Code First.
- Last but certainly not least there was some enhancements to the DbContext and database discovery.
- Go to the DbContext file and right click
- Under Entity Framework there are four new options
- View Entity Data Model (Read-Only) : This will display the code first model in the Entity Framework Designer in read only mode. Still nice to be able to visually see the model.
- View Entity Data Model XML : This will display the EDMX XML representation for the Code First models.
- View Entity Data Model DDL SQL : This will display the DDL SQL needed to create the database for the Code First models.
- Generate Views : Same as database and model first. This is a nice performance boot. How this works is that before EF can execute any type of query it has to create views of the database. In order to increase the performance these views can be pre build, this makes life easier to create those files.
power tools are always nice since you dont need to exert too much effort. ..
Brand new content on our very own blog site
http://www.prettygoddess.com