EntityFramework-Reverse-POCO-Code-First-Generator icon indicating copy to clipboard operation
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard

Option to delete entity class files when regenerating

Open NeilN1 opened this issue 3 years ago • 2 comments

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?

NeilN1 avatar Jul 20 '22 17:07 NeilN1

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.

sjh37 avatar Jul 20 '22 19:07 sjh37

Okay, thanks for the consideration.

NeilN1 avatar Jul 20 '22 19:07 NeilN1