sjh37 / EntityFramework-Reverse-POCO-Code-First-Generator

EntityFramework Reverse POCO Code First Generator - Beautifully generated code that is fully customisable. This generator creates code as if you reverse engineered a database and lovingly created the code by hand. It is free to academics (you need a .edu or a .ac email address), not free for commercial use. Obtain your licence from
https://www.reversepoco.co.uk/
Other
700 stars 230 forks source link

Option to delete entity class files when regenerating #767

Open NeilN1 opened 1 year ago

NeilN1 commented 1 year ago

Can we have the option to delete entity class and related files when a tt file is saved and the entity no longer exists in the database or the entity is renamed using the renaming service?

sjh37 commented 1 year ago

It already does this for the older .NET Framework projects, using Settings.FileManagerType = FileManagerType.VisualStudio;. However for EFCore projects this is more tricky as the .csproj project file does not contain any .cs filenames.

I fully understand what you need, but we also have to be careful with which files we delete.

I do have a solution in mind, and it's to log the files generated in a ReversePocoGenerated.txt file. This can be read in by the generator, files deleted, and re-created again. It would also serve as documentation to what the generator created.

NeilN1 commented 1 year ago

Okay, thanks for the consideration.