Can we use tt templates instead of T4 templates in Custom Scaffolding for generating Controllers & views.
Or do we have a tool for converting tt templates to t4 templates ?
Please suggest.
Thanks & Regards
Christena
The tt templates are t4 templates, just the file extension is tt.
See the location of the files:
How do I create my own Scaffold Template in ASP.NET MVC 3?
Related
When I do some changes in the style.scss file of this Abp template, I do not find these changes in the associated style.css file.
I learned about grunt (which could play the combination and minification?) but I'm not comfortable because the basic examples do not quite fit with the abp template.
Could you tell me how to update the css files of the solution when scss files are modified?
The ABP Template is this one : ASP.NET MVC 5 v3.6 with Module Zero & MPA.
Source code is here: https://github.com/aspnetboilerplate/module-zero-template/tree/master/src/AbpCompanyName.AbpProjectName.WebMpa
Thanks!
I have ASP.NET MVC 3 project with Razor syntax. Now I implement js code inline html markup. It's temporaly case. Now I would like use TypeScript in my project.
Could you please how I should add typescript into my project instead of inline js code?
Could you please how I should add typescript into my project instead of inline js code
Instead of inline js use a script tag : http://www.w3schools.com/tags/tag_script.asp
and compile your TypeScript to JavaScript. More : https://www.youtube.com/watch?v=RWXGMug_Rmo&hd=1
I've been searching for an example on how to use Entity Framework (ObjectContext/DbContext) inside of T4 template. How can I achieve this? Currently in my T4 I need to get values from database tables to generate files.
T4 template is just C# or VB.NET code inside some markup so you will use it in the exactly same way as you do that in any other code file.
When I 'run' a T4 template, the class files it generates for me all appear under the template. I cannot remove the template from the project without the files going away too. I also can't copy the files out from 'under' the template into the project root because the are already in the project root. How can I emancipate these files from the template that created them?
Get creative:
Right click and open containing folder.
Drag-and-drop the generated file to another location in the solution.
Delete the original template and file from Visual Studio.
Presto.
If you want to do one-time code-generation with T4 then I would suggest using T4 scaffolding. This tool was originally created to support the generation of views, controllers etc. in MVC3 but you can use it on pretty much anything.
Is there a way to automatically run the T4 transform when another file is saved?
The AutoRunCustomTool Visual Studio extension was created to address this exact scenario.
It seems like T4 Toolbox is not available for VS2012. However there is now a feature in tangible T4 Editor that allows you to simply add a auto-transformed template to any exisitng file in your solution so that when the parent file is saved the dependend t4 file is transformed. See here:
http://t4-editor.tangible-engineering.com/blog/dependent-t4-templates.html
You can do that with T4 Toolbox. Select the file in Solution Explorer and set the Custom Tool Template in the Properties window.
I get this answer form How can set the custom tool property of an xml file to a T4 file?