EF Core Database-First: Entity Names are Incorrect

Sonya Nadesan 20 Reputation points
2024-11-13T16:05:05.6866667+00:00

We have a table called IntrbankCurves.

When scaffolding, an entity class is created with the name InterbankCurf.

This is the command I am using:

Scaffold-DbContext "Data Source=ExampleSource;Initial Catalog=ExampleDB;Integrated Security=SSPI;TrustServerCertificate=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir ExampleDir -ContextDir DbContext -Context ExampleContext -ContextNamespace Example.Context -UseDatabaseNames -Force

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
764 questions
0 comments No comments
{count} votes

Accepted answer
  1. Hongrui Yu-MSFT 3,165 Reputation points Microsoft Vendor
    2024-11-14T05:55:22.2466667+00:00

    Hi,@Sonya Nadesan. Welcome to Microsoft Q&A.

    You could use -NoPluralize, the full command.

    Scaffold-DbContext "Data Source=ExampleSource;Initial Catalog=ExampleDB;Integrated Security=SSPI;TrustServerCertificate=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir ExampleDir -ContextDir DbContext -Context ExampleContext -ContextNamespace Example.Context -UseDatabaseNames -Force -NoPluralize
    

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.