0

I am using EF Core Power Tools (v 2.5.1277) to reverse engineer SQL Server database tables and stored procedures via the Reverse Engineer option.

My problem is specifically with stored procedures and T4 templates. The tool generates a partial interface and partial class (i.e. IDatabaseContextProcedures and DatabaseContextProcedures) to handle calling the stored procedures in addition to the DbContext itself.

However, only the DbContext has a T4 template file. I would like to use T4 templates to customize the "Procedures" objects. Is there a way to do so?

I tried adding a "Procedures" T4 template to the project but Power Tools Reverse Engineer does not seem to recognize it. Do I need to register the template with Power Tools somehow?

I also tried to generate multiple files from the DbContext.t4 file using T4.FileManager.VisualStudio but Power Tools Reverse Engineer fails with a "System.InvalidOperationException: Reverse engineer error".

This is a .NET 6 application using EF.Core 7

Thank you

Nick
  • 1
  • 2
  • It is not possible. Please create an issue on Github and explain why you need to modify the code generated for stored procedures. – ErikEJ Feb 08 '23 at 06:32
  • @ErikEJ Thank you for your response and for the tool in general! If T4 templates are not possible, may I ask you one other question? I have some procs that return multiple results which are mostly scalar, however the tool generates multiple classes "ResultSet1", "ResultSet2", etc, which is a bit overkill for my purposes. Changing the procs is beyond the scope of my effort, so I manually updated the code to remove these classes and just use scalar types but on refresh the methods just get overwritten. Is it possible to avoid this overwrite somehow? – Nick Feb 08 '23 at 15:36
  • Let's discuss on Github please – ErikEJ Feb 09 '23 at 06:02

0 Answers0