You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scaffolding should support singularizing table names but retaining column names exactly at the same time. This appears to not be supported at this time. UseDatabaseNames appears to switch off the singularization for tables names (I'm using Bricelam.EntityFrameworkCore.Pluralizer which works great).
I'd like the mapping like this:
table Customers => class Customer
column CustomerID => property CustomerID
When UseDatabaseNames == true, the class ends up named Customers which is undesirable. With UseDatabaseNames == false, the class is named well but ID becomes Id. There are other examples for column names that are undesirable such as "RequestUACPU" becoming "RequestUacpu". UACPU is a name for an HTTP header. It should be cases as specified in the database.
This is a problem for these reasons:
It breaks existing code assuming specific names of database columns. This is particularly relevant for our LINQ 2 SQL migration.
The modified casing for columns leads to undesirable names. For example, Id is the wrong name according to certain naming conventions. On .NET, abbreviations of at most two characters generally are uppercase. "Id" reads like the Latin word "id" (or like "id software"). But the correct pronunciation is I-D.
Names have been defined as desired in the database. There is no need to deviate from that. The developers should have the final say over naming because every project and team are different in their choices.
I realize can I simply rename the property. But we are speaking of about 1000 tables here. Also, I'd like an automated, repeatable process for reverse-engineering so that we can incorporate database changes. Our workflow starts with creating the database schema. The ORM is downstream. Scaffolding must be a simple workflow. Scaffold-DbContext is great for that but the naming needs a little bit more customization.
To summarize, there should be a setting that controls singularization for table names. An independent setting should control how column names are treated.
The text was updated successfully, but these errors were encountered:
Scaffolding should support singularizing table names but retaining column names exactly at the same time. This appears to not be supported at this time.
UseDatabaseNames
appears to switch off the singularization for tables names (I'm using Bricelam.EntityFrameworkCore.Pluralizer which works great).I'd like the mapping like this:
When
UseDatabaseNames == true
, the class ends up namedCustomers
which is undesirable. WithUseDatabaseNames == false
, the class is named well butID
becomesId
. There are other examples for column names that are undesirable such as "RequestUACPU" becoming "RequestUacpu".UACPU
is a name for an HTTP header. It should be cases as specified in the database.This is a problem for these reasons:
Id
is the wrong name according to certain naming conventions. On .NET, abbreviations of at most two characters generally are uppercase. "Id" reads like the Latin word "id" (or like "id software"). But the correct pronunciation isI-D
.I realize can I simply rename the property. But we are speaking of about 1000 tables here. Also, I'd like an automated, repeatable process for reverse-engineering so that we can incorporate database changes. Our workflow starts with creating the database schema. The ORM is downstream. Scaffolding must be a simple workflow.
Scaffold-DbContext
is great for that but the naming needs a little bit more customization.To summarize, there should be a setting that controls singularization for table names. An independent setting should control how column names are treated.
The text was updated successfully, but these errors were encountered: