[ACCEPTED]-How turn off pluralize table creation for Entity Framework 5?-pluralize
Accepted answer
You can write this code in OnModelCreating 1 method:
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
If you don't want EF to create tables and 3 manage consistency between you model and 2 database just use this at the startup of 1 your application:
Database.SetInitializer<CountryContext>(null);
Using LINQ in EF 6.0:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
var conventions = new List<PluralizingTableNameConvention>().ToArray();
modelBuilder.Conventions.Remove(conventions);
}
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.