What is purpuse of T4 Generator in T4toolbox

Posted by Fred Yang on Stack Overflow See other posts from Stack Overflow or by Fred Yang
Published on 2010-04-08T14:21:13Z Indexed on 2010/04/08 14:23 UTC
Read the original article Hit count: 560

Filed under:

I am using T4toolbox, I am confused what the generator is for. I can run the following

public class Generator1 : Generator {

protected override void RunCore()
{

    Template1 t = new Template1();
    t.Output.File = "t3.txt";
    t.Render();

}

}

or I can run t4 script directly like the following.

Template1 t = new Template1();

t.Output.File = "t3.txt";

t.Render();

But I can do the same using t4 script without generator as well. So I mean can do the same thing with two approach "script --> generator --> template" and "script --> template", am I missing something?

Thanks

© Stack Overflow or respective owner

Related posts about T4