public static void AddPluralizingTableName(this ModelBuilder modelBuilder) { Pluralizer pluralizer = new Pluralizer(); foreach (IMutableEntityType entityType in modelBuilder.Model.GetEntityTypes()) { string tableName = entityType.Relational().TableName; entityType.Relational().TableName = pluralizer.Pluralize(tableName); } }
public static void AddSingularizingTableName(this ModelBuilder modelBuilder) { Pluralizer pluralizer = new Pluralizer(); foreach (IMutableEntityType entityType in modelBuilder.Model.GetEntityTypes()) { //string tableName = entityType.Relational().TableName; //entityType.Relational().TableName = pluralizer.Singularize(tableName); string tableName = entityType.GetTableName(); entityType.SetTableName(pluralizer.Singularize(tableName)); } }