Open IvanFarkas opened 2 years ago
Hi @IvanFarkas,
I think you're on the right track. You'll want to follow guidelines for Taking Full Control by Extending Handlebars Generators. Create a class that inherits from HbsCSharpDbContextGenerator
, then override the GenerateClass
method. You can see an example of this pattern with the HbsCSharpEntityTypeGenerator
in the ef-core-community-handlebars repo.
Thanks also for the kudos!
How DbSet names can be customized?
I find this tool amazing and invaluable. Thank you very much Tony for your contribution.
I've seen the previous similar questions, but the answer is wage or perhaps I missed something.
I customized Entities massively using the
EntityTypeGenerator
andScaffoldingDesignTimeServices
. I even added a data dictionary to translate meaningless and totally unnecessary abbreviations (num -> Number, amt -> Amount, ind -> Indicator, etc.) in table names and columns to a modern naming convention that could be a good base for domain driven design.I tried to use
DbContextGenerator
likeEntityTypeGenerator
, but I could not accomplish it easily. The only alternative I found is to replicate theHbsCSharpDbContextGenerator
class and use my version of theGenerateClass()
method to set theset-property-name
dbSets
Dictionary item used inDbSets.hbs
Any help, pointer is greatly appreciated. Again, thx Tony for this marvelous tool!