Page 1 of 1

How to configure navigation property naming format?

Posted: Wed 03 Mar 2021 16:11
by RobertK
How to configure nagivation naming format?

Example
Account_CountryId

Navigation properties like this
Object_ColumnName
Objects_ColumnName

instead
Object <-- singular
Objects <-- plural

Re: How to configure navigation property naming format?

Posted: Wed 03 Mar 2021 16:12
by RobertK
Is it also possible to refresh and rename all navigation properties in this format?

Re: How to configure navigation property naming format?

Posted: Thu 04 Mar 2021 14:18
by Shalex
RobertK wrote: How to configure nagivation naming format?
Open Model Settings, navigate to Synchronization > Model Naming > the Class Properties' Names section, and check available options, for example:
* Pluralize collection navigation properties
* Add constraint details to navigation properties
RobertK wrote: Is it also possible to refresh and rename all navigation properties in this format?
The new settings will be applied to newly added entities only. You can recreate the model.

Re: How to configure navigation property naming format?

Posted: Fri 05 Mar 2021 04:47
by RobertK
Shalex wrote: Thu 04 Mar 2021 14:18
RobertK wrote: Is it also possible to refresh and rename all navigation properties in this format?
The new settings will be applied to newly added entities only. You can recreate the model.
recreate models destroys my diagram layout, I would prefer if I could click on a button and it would tell me which model/property does not meet standard format.

Re: How to configure navigation property naming format?

Posted: Fri 05 Mar 2021 13:19
by Shalex
There is no such option currently. We will investigate the question.

Re: How to configure navigation property naming format?

Posted: Sat 05 Jun 2021 07:48
by RobertK
I'm still unable to correctly configure the navigation properties.

Example
You have two class models CreditCard and Address
CreditCard has a foreignkey called "BillingAddress"

>CreditCard
Id
Name
Number
...
BillingAddressId <-- foreign key to "Address"
--
>Navigation Properties
BillingAddress <-- (this is the correct name, it is the name of the column without "ID", by default this nagivation property is set to "Address")

>Address
Id
Name
...
>Navigation Properties
CreditCards_BillingAddress <-- (this is the correct name, it is the name of the foreignkey class model underscore column name without ID, by default this nagivation property is set to "CreditCards")

Re: How to configure navigation property naming format?

Posted: Sat 05 Jun 2021 13:10
by RobertK
Ideally would want this navigation properties naming pattern
(example only, does not represent a realworld database design)

Image

Re: How to configure navigation property naming format?

Posted: Mon 07 Jun 2021 14:39
by Shalex
The "Add constraint details to navigation properties" option from Model Settings produces the naming pattern 2 b) from your screenshot. It works for Database-First only at the moment. We will investigate the possibility to apply this option for Model-First as well and notify you about the result.