0

I am developing an application in .net core , used below command to create Entities

Scaffold-DbContext "Server=DBSERVER;Database=ExpenseManager;Trusted_Connection=false;
User ID=****;Password=*****;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

It created entities like below from database first approch,my table names are Expenses,Incomes,Users

 public virtual DbSet<Expenses> Expenses { get; set; }
 public virtual DbSet<Incomes> Incomes { get; set; }
 public virtual DbSet<Users> Users { get; set; }

But want to use singularise in object name like below

public virtual DbSet<User> Users { get; set; }

I tried Nick N answer in EntityFramework Core database first approach pluralizing table names

but it is not working.

Please help

Rex Rex
  • 1,030
  • 1
  • 8
  • 29

1 Answers1

0

Try to install the Package Bricelam.EntityFrameworkCore.Pluralizer from Manage NuGet Packages or Package Manager Console and then run Scaffold-DbContext command. You could refer to here .

Xueli Chen
  • 11,987
  • 3
  • 25
  • 36