Uppercase always converted to PascalCase
See original GitHub issueHi, we use your extension with great appreciation for some months now. Since version 2.5.1057 the reverse engineering of the database brings us problems: Multiple consecutive cases in table names as well as column names are since that version always converted to PascalCase. Because we generated our Entities project months ago (with an old version of the extension), all our Entities are named as we want. But since version 2.5.1057 (because of #1440 I guess) it is always converted to PascalCase and we don’t want that, because our code already uses the old Entity names. That would give us huge refactor work. See screenshot below for an example.
My suggestion would be to add an option to disable the conversion to PascalCase, because otherwise we have to refactor our whole code because of the naming problem. I do have an renaming.json that strips some prefixes like “tbl” of the table names, but adding renaming for around 1000 tables to that file is almost impossible.
I have seen #1489 and I tried with the latest daily build (2.5.1113) but it still does not work.
Provide steps to reproduce
efpt.config.json
{
"CodeGenerationMode": 2,
"ContextClassName": "MyDbContext",
"ContextNamespace": null,
"DefaultDacpacSchema": null,
"FilterSchemas": false,
"IncludeConnectionString": false,
"ModelNamespace": null,
"OutputContextPath": "Context",
"OutputPath": "Models",
"ProjectRootNamespace": "Entities",
"Schemas": null,
"SelectedHandlebarsLanguage": 0,
"SelectedToBeGenerated": 0,
"Tables": [//snip],
"UiHint": "MyConnection",
"UseBoolPropertiesWithoutDefaultSql": false,
"UseDatabaseNames": false,
"UseDbContextSplitting": true,
"UseFluentApiOnly": true,
"UseHandleBars": true,
"UseHierarchyId": false,
"UseInflector": true,
"UseLegacyPluralizer": false,
"UseManyToManyEntity": true,
"UseNoConstructor": false,
"UseNoDefaultConstructor": true,
"UseNoNavigations": false,
"UseNoObjectFilter": false,
"UseNodaTime": false,
"UseNullableReferences": true,
"UseSchemaFolders": true,
"UseSpatial": false
}
efpt.renaming.json (partial):
[{
"ColumnPatternReplaceWith": "",
"ColumnRegexPattern": "^(vch|bit|dtm|int|dec|nvc|sin|chr|nch)",
"SchemaName": "dbo",
"TablePatternReplaceWith": "",
"TableRegexPattern": "^tbl",
"Tables": [ ],
"UseSchemaName": true
}]
Example SQL:
CREATE TABLE [dbo].[tblGGD](
[vchThisIsUPPERCASE] [nvarchar](7) NULL
)
Expected output: GGD.ThisIsUPPERCASE
Provide technical details
-
EF Core version in use: EF Core 6
-
Is Handlebars used: yes C#
-
Is .dacpac used: no
-
EF Core Power Tools version: 2.5.1057+ and also tried 2.5.1113
-
Database engine: SQL Server
-
Visual Studio version: Visual Studio 2022
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
“PreserveCasingWithRegex”: true option added in latest daily
Yes, I just wanted you to verify the fix first