By Kevin Hazzard and Jason Bock
Text Template Transformation Toolkit T4 has become quite popular in recent years thanks to a number of factors, most importantly the adoption of T4 by various tool-building teams within Microsoft’s developer division. Code generators for ASP.NET MVC, the ADO.NET Entity Framework, and other popular frameworks are based on T4, making it one of the most widely used tool-building frameworks around. In this article based on chapter 6 of Metaprogramming in .NET, authors discuss the T4 templating basics.

Introducing T4 (PDF)