T4 Confusion

I think I understand the basic principles of T4, but it's hard for me to figure out how to apply it to my specific situation.

I have an application that displays lists of objects of some type - it doesn't matter what. I want to allow users to select one or more of these objects and send them to any template. A template can generate, for example, an html file that describes objects or a powershell script to manipulate them in some way or in some way.

I cannot figure out how to pass the selected objects to my own host.

I could create an extensive include tt file that my own api called to retrieve these objects from my repository, but it seems silly when I already have instances of objects in scope and I just want to examine them to create some text output .

Hope this makes sense ...

I tried adding properties to my host and then used a host specific parameter. I thought I could use objects through these properties, but all I get is errors in serialization, etc.

A really good example of how to do this would be fantastic :)

thanks

+3
source share
1 answer

, . " " . - . , ( T4, , T4) TextTransform.exe.

+3

Source: https://habr.com/ru/post/1707408/


All Articles