ErikEJ / EFCorePowerTools

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

Specified table name is being ignored #1766

Closed MisinformedDNA closed 1 year ago

MisinformedDNA commented 1 year ago

AnimalSpecies is renamed to AnimalSpecy.

Provide steps to reproduce

  1. Add a table named t_AnimalSpecies
  2. Reverse engineer the DB
    1. Rename the table to AnimalSpecies

EXPECTED: Creates the type AnimalSpecies

ACTUAL: Creates the type AnimalSpecy

public virtual DbSet<ProductSpecy> ProductSpecies { get; set; }

I've tried with and without the EF6 pluralizer.

I've also tried with a regex to rename the table, but also no help.

"TablePatternReplaceWith": "$1",
"TableRegexPattern": "^[t|v|f|a]_(.+)",

Humanizer does make species an uncountable.

Provide technical details

ErikEJ commented 1 year ago

Have you tried making the whole word uncountable via the config file?

MisinformedDNA commented 1 year ago

Are you referring to the efpt.renaming.json file? That got generated properly per the repro steps.

Our are you saying there is a way to mark AnimalSpecies as an uncountable?

ErikEJ commented 1 year ago

Our are you saying there is a way to mark AnimalSpecies as an uncountable?

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

MisinformedDNA commented 1 year ago

Perfect.