Subject says it all.
I want to modify the POCO generation adapter (at http://code.msdn.microsoft.com/EFPocoAdapter ) to generate my own code. I have the .tt adapters done, but I want to be able to distribute this to coworkers, so they right-click on the model, choose "Generate Code", and my t4 templates appear in the options along with the other choices.
Is there an easy way to do this? I found some articles at http://msdn.microsoft.com/en-us/library/tsyyf0yh(VS.80).aspx but it was focused on generic templates, and I'm looking for sp开发者_JS百科ecifically model templates.
For processing T4 templates you have to use Microsoft.VisualStudio.TextTemplating.dll
The Microsoft.VisualStudio.TextTemplating namespace provides classes for the text template transformation functionality. The text template transformation engine is integrated into Visual Studio, and transforms text template files into generated text output files.
The text template transformation process takes a text template file as the input, performs the transformation on the input, and generates a new text file as the output. The engine component controls the process, and interacts with a text template transformation host and one or more text template directive processors to complete the process. For more information, see Generating Artifacts Using Text Templates.
Regards
s
精彩评论