Entities are not converted to pascal case when all tables are renamed using json config
See original GitHub issueFirst of all, thanks for the brilliant tool. it works quite well.
All of my tables have name in capital letter, separated by “_” for example
- PREFIX_PURPOSE_SUMMARY
- PREFIX_ANOTHER_PURPOSE_SUMMARY
If I use the PowerTool or EF core scaffold without .renaming.json then it converts all DBSet names in pascal case correctly as below
- PrefixPurposeSummary
- PrefixAnotherPurposeSummary
Since all of my tables have same prefix (don’t ask me why), I want the generated entities to not have this prefix, so I used .renaming.json with following config
[
{
"SchemaName": "SchemaName",
"UseSchemaName": false,
"TablePatternReplaceWith": "",
"TableRegexPattern": "((^PREFIX)?([ _,]+))"
}
]
This works, and I get the entities generated without the prefix (great!), however the resultant entity names are not converted into PascalCase, so my generated entities now look as below
- PURPOSESUMMARY
- ANOTHERPURPOSESUMMARY
In summary, pascal casing is not applied if table pattern replacement is used with regex. It looks like, this is a minor change in the code, I am happy to submit pull request if you want, however please let me know if I have got the configuration wrong?
Provide technical details
-
EF Core version in use: EF Core 6
-
Is Handlebars used: no
-
Is .dacpac used: no
-
EF Core Power Tools version: 2.5.1007.0
-
Database engine: Oracle
-
Visual Studio version: Visual Studio 2019
Issue Analytics
- State:
- Created a year ago
- Comments:14 (9 by maintainers)
Top GitHub Comments
Sorted thanks for the speedy reply. Previously posted json would change to be the following for anyone else who stumbles across this having the same issue.
{ “ColumnPatternReplaceWith”: “”, “ColumnRegexPattern”: “^(tbl)”, “SchemaName”: “SchemaName”, “TablePatternReplaceWith”: “”, “TableRegexPattern”: “^(tbl)”, “Tables”: [ { “Columns”: [ ], “Name”: “tblSIMCard”, “NewName”: “SIMCard” } ], “UseSchemaName”: false }
You should be able to override by adding a renamer for the affected tables where name and newname are the same.