ErikEJ / EFCorePowerTools

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

Pluralization problem during reverse engineering #1918

Closed trofimich closed 1 year ago

trofimich commented 1 year ago

Pluralize works incorrectly and I don't see ways to fix it via configuration. Sample: Database table "Gas". The Reverse engineering produces the next result in a DbContext: public virtual DbSet<Ga> Gas { get; set; }

Expected result: public virtual DbSet<Gas> Gases { get; set; }

In efpt.config.json:

   "UseDatabaseNames": false,
   "UseInflector": true,
   "UseLegacyPluralizer": false,

In https://github.com/Humanizr/Humanizer#pluralize I see an option "inputIsKnownToBeSingular". Shouldn't its value be configurable from efpt.config.json? It would be good to be able to add words into Humanizer Vocabulary also.

ErikEJ commented 1 year ago

Have you tried adding uncountable words?

https://github.com/ErikEJ/EFCorePowerTools/wiki/Reverse-Engineering#pluralization

ErikEJ commented 1 year ago

If you like my free tools, I would be very grateful for a rating or review on Visual Studio Marketplace or even a one-time or monthly sponsorship

trofimich commented 1 year ago

As i know, the word "gas" from my sample is countable: https://grammarist.com/usage/gases-gasses/ I have not tried uncountable words for countable words. And I assume this is correct.

ErikEJ commented 1 year ago
   "UncountableWords": [
    "Gas"
   ],

This is what the tool can offer, and I have no plans for additional Humanizer customizations.