-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capitalized characters in table name not importing correctly #1616
Comments
You can also do custom renaming on table level. And you can do bulk renaming based on a regex. |
I can confirm that if I make a [
{
"SchemaName": "dbo",
"Tables": [
{
"Columns": [ ],
"Name": "MECDatas",
"NewName": "MECDatas"
},
{
"Columns": [ ],
"Name": "MECGroups",
"NewName": "MECGroups"
},
{
"Columns": [ ],
"Name": "MECMeters",
"NewName": "MECMeters"
}
],
"UseSchemaName": false
}
] and run it using both "Pluralize singular generated object names (English)" and "Use EF6 pluralizer" enabled, that it indeed matches the names that EF6 EDMX would generate in the past! So I'm happy to find that I can get things to match EF6 behavior. I think other new users of this tool might also find it confusing that:
If the capitalization changes are happening in your code (as opposed to EF Core code), maybe adding a "Preserve capitalization" checkbox might clear things up for other people who might run into this? Using the |
Maybe Improve the docs of what Pluralizer does? And also enhance the docs of the renaming.json file? |
Yeah, I suppose that would help. What's confusing to me is the order of the operations. The Again, I'm happy with the workaround I have. Just trying to reduce other people from being confused about what the order of operations and what happens when, why the I'm a complete newbie to EF Core--and just 'used' EF 6--so maybe that's part of the problem. Thanks again! |
The change of MECMeter to Mecmeter always happens, it has not to do with Pluralization. All identifiers are C#-ified by EF Core. I think the main friction here is that you are in a group of users of this tool that come form EF6 and are not willing to do a clean cut (and/or start with a greenfield approach). But I am delighted that the tool has enough flexibility to accomodate your EF6 based requirements. |
Database I'm using has lots of tables with capitalized letters, due to abbreviations (like "MECMeter" and "MECModel" and "MECEnergy"). Also, certain columns I need to have renamed when their Entity version is created. Using EF Core Power Tools, I have not been able to both:
To be clear, I can do one OR the other in the above 2 bullets.
The only way I have found to get the tables names to come in with their original capitalization, is to enable "Use table and column names directly from the database". (If I don't do that, then I get "Mecmeter", "Mecmodel", "Mecenergy", etc.). But once I enable that, then the ability to F2 on a column name and change it (e.g., from "Value" to "RawValue") no longer actually impacts anything.
I'm attempting to come from EF6, so I've also enabled "Pluralize singular generated object names (English)" and "Use EF6 pluralizer".
Provide steps to reproduce
a. Use the F2 feature to rename "Value" to "RawValue"
b. Enable "Pluralize singular generated object names (English)" and "Use EF6 pluralizer".
c. Generate the Entity files. Note that results are fine EXCEPT that the class is called "Mecmeter"
Provide technical details
EF Core version in use: EF Core 6
Is Handlebars used: no
Is T4 used: no
Is .dacpac used: no
EF Core Power Tools version: 2.5.1
Database engine: SQL Server (database has compatibility set to 2012, server itself is version 13.0.7016.1)
Visual Studio version: Visual Studio 2022 (17.4.2)
The text was updated successfully, but these errors were encountered: