Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dotnet 5 scaffold changing table names

I have a database with tables like this: productos parametros

before .net5 when I run the Scaffold command

dotnet ef dbcontext scaffold "..............." "Pomelo.EntityFrameworkCore.MySql" -o dbFacturacion -f

I got the classes like this:

Productos
Parametros

But after I upgrade to .net5 after run the Scaffold command now the classes are like this:

Producto
Parametro

What I can do to keep the old table name format?

like image 966
DanielRamiz Avatar asked Oct 12 '25 15:10

DanielRamiz


2 Answers

It is because pluralization is enabled by default in EF Core 5.

Use the --no-pluralize option

like image 169
ErikEJ Avatar answered Oct 14 '25 04:10

ErikEJ


In PMC the option is -NoPluralize

like image 37
FERNANDO BENITEZ Avatar answered Oct 14 '25 05:10

FERNANDO BENITEZ