Thursday, April 12, 2012

Using ObjectContext / DbContext inside T4 Text Template

I've been searching for an example on how to use Entity Framework (ObjectContext/DbContext) inside of T4 template. How can I achieve this? Currently in my T4 I need to get values from database tables to generate files.

1 comment:

  1. T4 template is just C# or VB.NET code inside some markup so you will use it in the exactly same way as you do that in any other code file.