Reputation: 4677
Is it possible to create a T4 template and do it appear when i add new item in visual studio? For exemple, when i want to add i new class i press right button in my solution, or any directory and choose Add > Add New Item, and now i select class, or interface...
I want to create T4 template to my specific Services, that i can have a ProductService, UserService, etc.. so, i want to do this: Right button in my solution, or any directory and choose Add > Add New Item, and now i select Service that 'll generate the code based in my T4 template.
Or a way to do that similar when we add a New Controller in visual studio when we are working with asp.net mvc 3 project that appear the option "Add Controller", in my case would appear "Add Service".
Upvotes: 3
Views: 1873
Reputation: 386
You can add T4 templates to your project by selecting "Text File" from the add new item dialog and giving the file a .tt extension. Overall, the editor support for T4 is pretty weak but there are a few extensions that help a bit.
Upvotes: 3