.TT files

I want to make a blog series about what you can do with .tt files. I do not mean now what cen be generated from edmx( I have blogged about that at

http://msprogrammer.serviciipeweb.ro/2010/09/27/generating-history-trigger-with-ef-edmx-and-tt-files/

and

http://msprogrammer.serviciipeweb.ro/2010/06/28/ef-automatic-history-of-table-and-t4-files-tt-files/

)

I will start from a .tt template that will be analyzing a class( the ViewModel in MVC terms ) and then,starting from this template,I will generate:

  1. Loading the class from config file( web / app)
  2. Generating resx files for translating
  3. Generating help / tooltip
  4. Generating logging for all methods ( with an _On convention)
  5. Generating shallow copy for the class,saving the properties and an Interface ( usually  good for DI / Ioc)
  6. Generating

I expect your suggestions too. What do you have iteratively do in your development( MVC Winking smile ) more than one time for each ViewModel ( Model) class ?

( this is the .tt file)


Posted

in

by

Tags:

Comments

One response to “.TT files”

  1. Siderite Avatar

    Great idea for a series. I am amazed of how few people know about T4 and what you can do with it. Probably it has to do with the impracticality of using them in Visual Studio, where you don’t have any way of controlling when to run them in regard to compilation.

Leave a Reply

Your email address will not be published. Required fields are marked *