T4

FacebookTwitter
Scaffolding

Design-Time Code Generation by using T4 Text Templates

http://msdn.microsoft.com/en-us/library/dd820620.aspx Design-time T4 text templates let you to generate program code and other files in your Visual Studio project. Typically, you write the templates so that they vary the code that they generate according to data from a model . A model is a file or database that contains key information about your application’s requirements. For example, you could have a model that defines a workflow, either as a table or a diagram.
http://msdn.microsoft.com/en-us/library/vstudio/bb126445.aspx For example, you could create a template to define an HTML page: <html><body> The date and time now is: <#= DateTime.Now #></body></html> Notice that the template resembles the generated output.

Code Generation and T4 Text Templates

Watch Overview on Channel 9 Text Template Transformation Toolkit (T4) is a template-based code generation engine. It is included with Visual Studio 2008 and available as a download for Visual Studio 2005 in DSL and GAT toolkits. You can use T4 templates to generate Visual Basic, C#, T-SQL, XML or any other text files.

T4: Text Template Transformation Toolkit

http://www.olegsych.com/2007/12/text-template-transformation-toolkit/
This post is a part of the series that introduces code generation with Text Templates (also known as T4 Templates) in Visual Studio using C# and Visual Basic; explains how to create reusable templates and combine them in complex code generators. In order to follow examples in this article, you need to have Visual Studio 2008 or 2010 Standard Edition or higher, SQL Server 2005 or later, T4 Toolbox and T4 Editor installed on your computer. Introduction In the first article of this series, we created the following text template to generate a DELETE stored procedure for a given database table using SMO . This stored procedure is one of the CRUD procedures that would need to be created to encapsulate access to this table.

T4 Tutorial: Creating reusable code generation templates

http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/