I have been using some customized M开发者_JS百科VC templates that really improve my productivity. However, I would like to take it to the next level.
I generate a controller template for each table in my app. The controller has Edit, List, Details, and Delete actions. What I would like to do, is at the same time trigger the generation of the views for those actions.
Does anyone have a reference or have suggestions on how this can be done?
It is not easy to generate multiple files from a single T4 template, but it can be done. A good tutorial is here.
You can use MVC Scaffolding have a look at this link
http://blog.stevensanderson.com/2011/04/06/mvcscaffolding-overriding-the-t4-templates/
Also I would invest in a Tool like the T4 Tangible Engineering editor the added intellisense is handy
精彩评论