A common way to get the DisplayName attribute is reflection. The problem you are about to have is .tt templates and reflection that do not fit together. Reflection is based on loading code into the AppDomain. Since .tt files do not actually load code, you cannot mirror them.
More on this issue and possible solution:
http://www.olegsych.com/2007/12/how-to-use-t4-to-generate-decorator-classes/
MVC and Visual Studio should use some code checking to generate some part of the generated file, so I would look at this path, maybe some crazy regular expression if you don't solve the reflection problem.
source share