3 ms·
A nice trick a lot of .Net devs don't use is code generation(T4 templates). Generate a Enitity Framework context, use Visual Studio to add a controller, select
by jabart 8y ago
A nice trick a lot of .Net devs don't use is code generation(T4 templates). Generate a Enitity Framework context, use Visual Studio to add a controller, select the context, basic crud and HTML generated.
I take that, style it, copy the code into the service layer and 70% of the boring code is done. I can't type fast enough to make that much code that error free and quick.
- colemickens 8y agoI've never had T4 in a project where I didn't immediately have problems. It also doesn't seem to really be a thing for .NET Core...
- jabart 8y agoIf you use Visual Studio, the Add Area, Add Controller's are all using T4 templates. VS Code may have a plugin for it, but that is why I mentioned Visual Studio, which I have to pay for so I use it more :)