t4

Where can I find some examples of using T4 to generate an Oracle DA layer?

Title says it all... I've seen the tutorials at http://www.olegsych.com/2007/12/text-template-transformation-toolkit/ but they don't translate directly to Oracle. ...

Running multiple T4 Templates with a single click

I have some 6 T4 templates spread through my solution in different projects, is it possible to run them all with a single click or do I necessarily need to go through them one by one? ...

Is there a way to use T4 templates with Subsonic 2.2

I understand Subsonic 3.0 is the latest and greatest, and I understand Subsonic 3.0 has T4 templates. But Subsonic 3.0 is not backwards compatible with Subsonic 2.2, meaning, my project with hundreds of code files written in the subsonic 2.2 query language will not work in Subsonic 3.0. So my question: Is there t4 templates someone ...

T4 template PropertyProcessor error

I need to use property processor="PropertyProcessor" directive for T4 templates using Visual Studio 2010, so I installed GAX 2010 form the IDE's Extension Manager. Although I installed it, the error **Error 2 A processor named 'PropertyProcessor' could not be found for the directive named 'property'. The transformation will not be ru...

T4 to generate Enum from SQL Server table values

What I want to achieve is more or less the inverse of this: http://www.olegsych.com/2008/07/t4-template-for-generating-sql-view-from-csharp-enumeration/ I have a value group table (enum names) and a values table (enum values), and want to turn those into enums. Both are in SQL Server, and both do happen to be in an .edmx (so there woul...

Create class files with T4 template

Hi, I have 82 procedures that create data tables, and i want to iterate through this tables and dynamically create the following classes for each data table: * The data table contain two columns: Id, Desc. e.g. CountryId, CountryDesc. * Each of the bold items in the example class below is dynamically create based on the data table i am u...

C# Using T4 to generate enums

In my project I'd like to use T4 to generate my enums. To test this, I created a test project with a simple form. In this project I added a .tt file and put my code into that file. Everything works, but I was a little bit disappointed. I thought that when the project gets executed, the T4 generates the enumeration. So the enumeration is...

Read classes in a namespace in a t4 template

is there a way I can read in a namespace and loop threw all the classes in a t4 template using reflection or something? <#foreach (class poco in LoadNamespace("Web.Code.Entities.Poco").Classes ) { #> public interface I<# poco.ClassName #>Repository { IQueryable< <# poco.ClassName #> > Get(); <# poco.ClassName #> Save(<# poco.C...

C# CodeModel Find out if CodeParameter is out or ref

I am using CodeModel inside of a T4 template to generate some code based from an interface. I am able to get the interface methods, parameter names, and parameter types but I can't seem to be able to find out wither the parameter is an out or ref parameter. http://msdn.microsoft.com/en-us/library/envdte.codeparameter.aspx foreach ( Cod...

Templating solution for prototype CMS

Hi, Bit of a vague question. Apologies. I have a prototype CMS I've been working on for fun. It's completely written in ASP.NET MVC. It works on the principle of "widgets". Little blocks of functionality that can be dragged and dropped on the page, you get the idea. I have added a few simple blogging widgets which work well, one of...

run automatically t4 templates

Hi, I would like to know if is possible to run a T4 template when saving a other file, example run my .tt file after/on saving a xml file I forgot to mention that my IDE is VS2010 ...

Getting the Schema from an EDMX file

I need to modify the T4 template POCO.tt to retrieve the database schema from the EDMX file. I can see the schema stored in an EntitySet tag in the XML. However I cannot find the schema anywhere when using an EntitySet object. Anyone know where I would find the database schema? Thanks ...

What T4 editing tools exist?

I don't use T4 templates often; usually when I do it is editing those of other projects (specifically SubSonic & T4MVC). The experience is always quite unpleasant (and this is certainly why I don't use them more often). These are the tools I know of, and neither of them quite fit the bill. Clarius Visual T4. Does not support Visual...

How to stop T4 from executing every time I switch to another tab?

When I edit T4, the script is executed every time I switch to another file. It is OK for quick simple scripts, but some scripts take long time to execute. Is there a way to disable this behavior? I want the script to run only when I save T4 file or manually choose "Run Custom Tool" from the menu. ...