问题
I am trying to get EF 5 to generate singular table names. I have the following code in my DbContext...
public partial class LiveoModelContainer : DbContext
{
protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)
{
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
base.OnModelCreating(modelBuilder);
}
}
We are using Model First, and have our own generated code to follow our internal development patterns. So we are not using the out of the box code gen that comes with EF. I have set pluralization to false in the edmx properties, in the Database Tools/O/R Designer, and removing the convention in the OnModelCreating above. However, the table names remain plural.
How do I fix this?
来源:https://stackoverflow.com/questions/12610524/entity-framework-plural-table-names