Open mtayyabviz opened 10 months ago
T4 and handlebars serve the same purpose of letting you control the output from scaffolding. You use JavaScript to customize the Handlebars template, and C# to customize the T4 template. T4 templates only work with EF Core 7 or newer.
I don't know but I found handlebar syntax more friendly, so I will prefer to use this rather than T4 :+1:
I would recommend only a partial class for the DbContext. For entities it would be better to use a base class for common functionality.
The other difference between Handlebars and T4 is that the former emphasizes a separation between the template and code. But you can accomplish the same result with either.
Is there a way to add configuration classes? Like when adding EntityTypeConfiguration.t4
I have just came across to this repository and also to T4 Templates.
My question is when you do scaffolding with
--force
your model codes and dbcontext classes gets overwritten. If you have tables around 100, should I have to create partial class for every single model? Please correct me I am wrongAlso, how effective is this as compared to T4 Templates that recommend you don't need to create partial classes but templates to handle your scaffolding.
Thank you!