Generate multiple files from single input

Oct 31, 2009 at 7:43 PM

Hi all

What's the best way to implement a single-input-multiple-output template? Am I right to attempt that or this is the task of code generator and not of a template?

Thanks in advance

Nov 1, 2009 at 12:11 AM
I am not exactly sure what you mean by 1 input and multiple outputs.

But it may help to know that I uploaded a full, working sample,
Repository pattern, in the Patches section-- it outputs one Manager
per table.

HTH.


>
Coordinator
Nov 1, 2009 at 12:11 PM

Using T4 Toolbox terminology, you need one Generator class per input and one Template class for each output type. A single Template instance can be reused to create multiple output files of the same type. Mark's sample illustrates this approach. Here's the background information on the subject: http://www.olegsych.com/2008/09/t4-tutorial-creating-complex-code-generators/.

Oleg

Nov 2, 2009 at 6:29 PM

romanfq --

FYI, I have added a new version of my sample at this link http://t4toolbox.codeplex.com/SourceControl/PatchList.aspx with the name of file being this "Northwind01_T4Sample_200911021411.zip" so check it out if you dare.

:-)

HTH.

Thank you.

-- Mark Kamoski