-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Naming issue in Reverse engineering of a DB #128
Comments
I was able to fix this as follows: Table Schema: CREATE TABLE [dbo].[Notifications]
(
[Id] INT NOT NULL PRIMARY KEY,
[SMSRecepient] nvarchar(50) NULL
) I then added a json file in same location as epft.config.json, named efpt.renaming.json [
{
"UseSchemaName": false,
"SchemaName": "dbo",
"Tables": [
{
"Name": "Notifications",
"Columns": [
{
"Name": "SMSRecepient",
"NewName": "SMSRecepient"
}
]
}
]
}
] I then ran Reverse Engineer with Pluralization enabled. This resulted in the following POCO class: public partial class Notification
{
public int Id { get; set; }
public string SMSRecepient { get; set; }
} And this DbSet:
|
Thanks user @tomzre !! |
Hi, thanks. Seems there was a misunderstanding:
|
Re 1 and 2: Thanks, I am aware of this limitation - EF Core Power Tools use the built-in Scaffolding in EF Core, and is subject to any issues and limitations caused by this. re 3: Yes, this is what using the json file allows you to control. (The behavior of the CandidateNamingService) 😄 - keep in mind that the tool does not run any code in your project. |
@DaniRK You may find this relevant: TrackableEntities/EntityFrameworkCore.Scaffolding.Handlebars#34 (comment) |
Thanks for a great tool!
Reverse engineering of a DB:
We try to migrate from EF6 to EF Core.
It seems currently there is no way to get both the following results:
Singularize/Pluralize and also disable the EF Core urge to "properly" Camelize/Pascalize names.
Changes in the DB occur quite often, so that reverse engineering will happen over and over again. Therefore it does not make sense to adjust the existing code base manually each time again.
Steps to reproduce
DB table "Notifications"
Column name: SMSRecepient, ...
in EF6, from which we migrate, with Pluralize option:
DbSet name: Notifications
POC Class name: Notification
Property names: SMSRecepient
Power Tools, with option "Pluralize/Singularize" checked:
DbSet name: Notifications
POC Class name: Notification
Property names: SmsRecepient (! Camelization/Pascalization)
Power Tools, with option "Use table and column names from the database" checked:
DbSet name: Notifications
POC Class name: Notifications (! wrong semantic)
Property names: SMSRecepient
There is currently no option in Power Tools to combine the two options
Further technical details
Toolbox/Power Tools version: 1.0.664
Database engine: SQL Server
Visual Studio version 15.7.4, SSMS 17.7)
The text was updated successfully, but these errors were encountered: