msawczyn / EFDesigner

Entity Framework visual design surface and code-first code generation for EF6, Core and beyond

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Empty / blank "File Name Marker"

npagare opened this issue · comments

Hi Michael, how are you ?

When I set File Name Marker to empty, the generated entity file name is having two dots in between file name and "cs". So e.g. for the entity Person the generated .cs file name is Person..cs which I was expecting to be Person.cs . Is this by design ? If so, can you help us to remove that empty node in the file name ? I would appreciate that.

Thank you.

Whoops! Thanks for the catch. That fix is in and will be out in the next release.

You should note that, depending on your workflow, there may be repercussions to not having a marker word in the generated code's file name. Not only is it less clear to the humans, source control systems and linters that this is generated code (so can be safely ignored), but there's a bit of logic in the T4s that does cleanup of dead files, and it wants to use the marker word to determine if the file was generated by the modeler or not. Haven't dug into what will happen with a blank marker, but wanted to throw that out there for you.

Thanks Michael.

How about having a default marker folder say ''generated' that could be renamed via properties panel. It will create namespace with that node for generated classes. There could be separate default folders for entities, enums, structs under the folder 'generated'.

The default path of the 'generated' folder can be under the root folder where .efmodel is stored - but could customized in properties window if developer want to spool generated code in a separate class library.

I also see that in the generated folder - code older or deleted entities from .efmodel diagram is not deleted. May I know if this is by design ? It will be really helpful to autodelete those files. I have been deleting manually before saving .efmodel to generate a fresh batch. Thoughts ?

Thank you.