Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

T4 alternative in .NET Core?

Tags:

c#

.net-core

t4

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?

like image 884
NBM Avatar asked Sep 04 '16 04:09

NBM


People also ask

Can I use VS code for .NET core?

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.

What is T4 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

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.

like image 136
OzieGamma Avatar answered Sep 27 '22 21:09

OzieGamma