0

I use this code to generate my project models:

Scaffold-DbContext "Server=.;User ID=*****;Password=*******;Database=*******;Trusted_Connection=True;Encrypt=False;" 
         Microsoft.EntityFrameworkCore.SqlServer 
         -OutputDir Models -force

After generating the classes, I see that EF generated PackageDatum class inside PackageData class - that is wrong!

public partial class PackageDatum
{
    public int Id { get; set; }
    public bool FloorOutOpen1 { get; set; }
}

My table name in the database is PackageData.

How can I fix this?

1 Answer 1

1

To disabe pluralization of the class names, use -NoPluralize switch on Scaffold-DbContext. See https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-5.0/breaking-changes#mitigations-18.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.