Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify template class visibility for a T4 preprocessed template?

I have started adding some preprocessed T4 templates to a VS2010 C# library project. They are implementation details only, and I would prefer to not have them exposed on the library's API. I have not found a way to set the template's generated class visibility to 'internal'.

Is there a way? (If there is, I assume it will be something obvious that I have missed)

Thanks in advance,

/AI/

like image 406
Aethon Invictus Avatar asked Dec 16 '10 22:12

Aethon Invictus


People also ask

How do T4 templates work?

T4 templates allow you to generate text in a similar way to how Razor pages allow you to generate HTML. It is a markup language that mixes C# with text. The text that is generated could be C# code or JSON. It could also be any text that you need to generate from some other data source.

What are T4 templates in Entity Framework?

T4 templates in entity framework are used to generate C# or VB entity classes from EDMX files. Visual Studio 2013 or 2012 provides two templates- EntityObject Generator and DBContext Generator for creating C# or VB entity classes. The additional templates are also available for download.


1 Answers

VS2012 has visibility="internal" on template.

like image 148
Martin Tapp Avatar answered Sep 22 '22 12:09

Martin Tapp