Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any alternatives to T4 templates and EnvDTE for cross platform asp.net 5 development?

We currently use T4 templates to generate C# code files based on C# Code (Entity POCO's) and the EDMX (in older applications)

Moving to ASP.NET 5 with a view to support cross platform development, are there any code generation tools available that can read a projects class & meta data structures, and to generate C# files at design time, similar to T4 templates?

like image 528
Mark Redman Avatar asked Jan 03 '16 15:01

Mark Redman


People also ask

What is t4 template in Entity Framework?

t4 template is used to scaffold a DbContext class for the database, and the EntityType. t4 template is used to scaffold entity type classes for each table and view in the database.


1 Answers

You can try Scripty - it is Roslyn based scripting.

  • Syntax highlighting for *.csx files works out of the box;
  • VS extension exists to process scripts on save;
  • MSBuild task exists to process scripts during buld process;
  • Script allows you to traverse a hierarchical model of the project;
  • Multiple files generation from single script is supported;
like image 85
rustam Avatar answered Oct 24 '22 05:10

rustam