user3581054
user3581054

Reputation: 123

SQL Server renames tables

I'm using a SQL Server from my hosting provider and the strangest things happen. The server sometimes renames my tables, to the english word - from swedish, and then uses that table instead of the one i have declared in my code first, even though its not even the same name? I use code-first Entity Framework, has anyone experienced this?

I.e: Personer, it renamed to People !

Upvotes: 1

Views: 106

Answers (1)

marc_s
marc_s

Reputation: 754468

EF uses an English-based pluralization/singularization system that might get in your way here.

Since it sees Person, it will change that table name to People which is the proper English plural for Person.

You can disable that "feature" with this code in OnModelCreating method:

modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

Upvotes: 3

Related Questions