Singularise or pluralize table name entities

.net asp.net-core asp.net-core-2.0 entity-framework entity-framework-core

Question

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

1
0
5/3/2019 7:05:09 AM

Popular Answer

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 .

0
5/3/2019 8:05:30 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow