0

Till now all my tables in the database were singular. After I added a new Entity (in the .edmx with the designer) and recompiled, all the tables were written in plural.

In the model browser: x.Database.Model.Store -> Tables / Views -> every single table is written in plural. But in: x.Database.Model -> Entity Types everything is still in singular.

I already tried following:

1: Override the OnModelCreating method (edited in the template)

    System.Data.Entity.Database.SetInitializer(new CreateDatabaseIfNotExists<LISADbConfiguration>());
    context.Database.Initialize(true);

public class LISADbConfiguration : LISADb
{
    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
    }
}

2: Set: Tools -> Options -> Database Tools -> O/R Designer -> Enabled = False

3: In the .edmx file directly in the properties: Pluralize New Objects = False

But still everything results in plural tables in the database / Model Browser.

Database: MSSQL 2014 EF: 6

Bin4ry
  • 652
  • 9
  • 34
  • 1
    `1` would never work, since OnModelCreating isn't called with EDMX. http://stackoverflow.com/questions/7189624/entity-framework-onmodelcreating-with-model-first. – Eris Feb 19 '17 at 18:03
  • Do your T4 generation files have the pluralization directive, like in http://stackoverflow.com/a/6563744 ? – Eris Feb 19 '17 at 18:06

0 Answers0