1

When scaffolding an existing DB Model there are several table names that end with an s. Like SaleOrderPos beeing pos short for position.

I want to pluralize the DBSet but keep intanct the original table name.

EF creates a class called SaleOrderPo

public virtual DbSet<SaleOrderPo> SaleOrderPos { get; set; }

Rather than working with Po classes I prefer to use the option -NoPluralize when calling to Scaffold-DbContext:

public virtual DbSet<SaleOrderPos> SaleOrderPos { get; set; }

Is there a way to generate a class called SaleOrderPos and a DbSet called SaleOrderPoss or SaleOrderPoses?

Thanks in advance.

Patxistein
  • 11
  • 2
  • Have you tried "-UseDatabaseNames" option? – ErikEJ Oct 14 '21 at 12:07
  • -UseDatabaseNames does not affect on the class name. It affects to entity property names, for example a column named t_column in DB, the property is TColumn. With -UseDatabaseNames it remains t_column. – Patxistein Oct 14 '21 at 14:48

0 Answers0