ErikEJ / EFCorePowerTools

Entity Framework Core Power Tools - reverse engineering, migrations and model visualization in Visual Studio & CLI
MIT License
2.16k stars 297 forks source link

Question: Are Stored Procedures / TVF resultsets available in the Model so that i can customize with .t4 templates? #2589

Closed CorsairRO closed 13 hours ago

CorsairRO commented 1 day ago

Hello,

thank you again for the very nice tool that you created and you maintain.

I have a question, i would like to use the .t4 templates option in there to generate my DTO classes in a Business Project by just copying all the properties from the Data Generated scaffolded obejcts. So that whenever i refresh a reveng from DB to automatically refresh my business objects.

I have already used the .t4 to customize the objects generated from tables and views and i think i know how to just duplicate them to a business project.

But, i cannot see any way in .t4 to get the stored procedures resultsets in there.

Is there any easy way to achieve that? Are those classes exposed somehow to the .t4 so that i iterate over them in the same style as i iterate through all Tables and Views ? Or i just will have to manually do that every time that i refresh a DB Model for a proc that returns my_sp_Result to manually copy the properties into my_sp_Result_DTO class?

Thank you for your help, Have a nice day

NOTICE: A bug report without sufficient technical and repro details and version information WILL BE CLOSED WITHOUT ANY FURTHER ACTION.

Provide steps to reproduce a bug

Please include a complete description of the issue or link to a project that I can run to reproduce the issue.

Provide technical details

ErikEJ commented 1 day ago

This built-in DatabaseModel in EF Core has no knowledge og stored procedures and result sets from these, som the T4 templates ignore them.

You can run the post generation copy from a efpt.postrun.cmd script.

ErikEJ commented 13 hours ago

@CorsairRO Hope you got your question answered?