a T4 text template is a mixture of text blocks and control logic that can generate a text file.
T4 templating is not natively supported in .Net Core.
Can anyone suggest to me T4 alternative in .NET Core?
How can we do code generation?
You can run an ASP.NET Core application from Visual Studio Code directly. To accomplish this, open the Command Palette, type dnx and press Enter.
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.
You could use Scripty. It looks quite nice and fits with the new Analyzers from Roslyn.
http://daveaglick.com/posts/announcing-scripty
https://github.com/daveaglick/Scripty
Since they are dropping the project.json format (https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/) you should be able to use Scripty from the .xproj
or .csproj
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With