Closed krossley closed 1 year ago
Remove the schema name and brackets
Erik, Thank you for your reply. I have tried what you suggested but I was not able to get it to work. Below is the code where I removed the Schema flag.
` "CodeGenerationMode": 2, "ContextClassName": "CoinCatalogContext", "ContextNamespace": null, "DefaultDacpacSchema": null, "FilterSchemas": false, "IncludeConnectionString": true, "ModelNamespace": null, "OutputContextPath": null, "OutputPath": "Models", "PreserveCasingWithRegex": true, "ProjectRootNamespace": "ReflectionApp",
"SelectedHandlebarsLanguage": 0, "SelectedToBeGenerated": 0, "Tables": [ { "Name": "[dbo].[Buffalo Nickel NGC]", "NewName": "[dbo].[Buffalo Nickel NG]", "ObjectType": 0 }, { "Name": "[dbo].[Buffalo Nickel PCGS]", "ObjectType": 0 } ], "UiHint": "bryans-x1\sqlexpress.CoinCatalog.dbo", "UncountableWords": null, "UseBoolPropertiesWithoutDefaultSql": false, "UseDatabaseNames": false, "UseDateOnlyTimeOnly": false, "UseDbContextSplitting": false, "UseFluentApiOnly": true, "UseHandleBars": false, "UseHierarchyId": false, "UseInflector": false, "UseLegacyPluralizer": false, "UseManyToManyEntity": false, "UseNoDefaultConstructor": false, "UseNoObjectFilter": false, "UseNodaTime": false, "UseNullableReferences": false, "UseSchemaFolders": false, "UseSpatial": false, "UseT4": false }`
Let me be more precise ( and suggest you read the wiki!)
You need to replace
[dbo].[Buffalo Nickel NGC]
With
Buffalo Nickel NGC
Erik, Thank you for your reply. I read the wiki first before contacting you. This is what I have tried without success.
` "Tables": [ { "Name": "[dbo].[Buffalo Nickel NGC]", "NewName": "Buffalo Nickel NG", "ObjectType": 0 },
I also tried this "Tables": [ { "Name": "Buffalo Nickel NGC", "NewName": "Buffalo Nickel NG", "ObjectType": 0 },`
Please share your create table statement
The second attempt might work, but unsure about all the spaces in the name
Erik, I have attached a file with a SQL statement that can be used to create the database table. I hope this is what you needed.
You need to re-read the wiki. the replacements need to go in a seperate file - and you cannot use spaces in C# names.
Erik, It's still not working. I will update on it later tonight.
Erik, One problem that I noticed is I did not have a JSON file called efpt.renaming.json . I created the file and use the code below. I have not been able to change the name.
`[ {
"SchemaName": null,
"TablePatternReplaceWith": null,
"TableRegexPattern": null,
"Tables": [
{
"Name": "BuffaloNickelNgc",
"NewName": "BuffaloNickelNGc"
}
],
"UseSchemaName": false
} ]`
The original name is the full table name. I think.
Erik, "Name": "BuffaloNickelNgc", //This code is what your tool named it on the reverse engineer of the table. "NewName": "BuffaloNickelNGc" // This is what I am trying to rename too. notice the NGc opposed to Ngc. Does the above code in the JSON file above look correct?
I will have another look, not sure if a change in just casing works.
You need to use
"Name": "Buffalo Nickel NGC",
"NewName": "BuffaloNickelNgc"
Erik, That did the trick! Sorry that was such a hassle. Than you so much for your help,
Cool! If you like my free tools, I would be very grateful for a rating or review on Visual Studio Marketplace or even a one-time or monthly sponsorship
Done! and Done! Thanks again Erik!
Describe what is not working as expected.
I can't get the "NewName" flag to work.
Please include a complete description or project that I can redo/run to reproduce the issue.
{ "CodeGenerationMode": 3, "ContextClassName": "CoinCatalogContext", "ContextNamespace": null, "DefaultDacpacSchema": null, "FilterSchemas": false, "IncludeConnectionString": true, "ModelNamespace": null, "OutputContextPath": null, "OutputPath": "Entites", "PreserveCasingWithRegex": true, "ProjectRootNamespace": "ReflectionApp", "Schemas": null, "SelectedHandlebarsLanguage": 0, "SelectedToBeGenerated": 0, "Tables": [ { "Name": "[dbo].[Buffalo Nickel NGC]", "NewName": "[dbo].[Buffalo Nickel NG]", "ObjectType": 0 }, { "Name": "[dbo].[Buffalo Nickel PCGS]", "ObjectType": 0 } ], "UseSchemaName": false, "UiHint": "BRYANS-X1\\SQLEXPRESS.CoinCatalog", "UncountableWords": null, "UseBoolPropertiesWithoutDefaultSql": false, "UseDatabaseNames": false, "UseDateOnlyTimeOnly": false, "UseDbContextSplitting": false, "UseFluentApiOnly": true, "UseHandleBars": false, "UseHierarchyId": false, "UseInflector": false, "UseLegacyPluralizer": false, "UseManyToManyEntity": false, "UseNoDefaultConstructor": false, "UseNoObjectFilter": false, "UseNodaTime": false, "UseNullableReferences": false, "UseSchemaFolders": false, "UseSpatial": false, "UseT4": false }