How to configure navigation property naming format?

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

How to configure navigation property naming format?

Post by RobertK » Wed 03 Mar 2021 16:11

How to configure nagivation naming format?

Example
Account_CountryId

Navigation properties like this
Object_ColumnName
Objects_ColumnName

instead
Object <-- singular
Objects <-- plural

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: How to configure navigation property naming format?

Post by RobertK » Wed 03 Mar 2021 16:12

Is it also possible to refresh and rename all navigation properties in this format?

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: How to configure navigation property naming format?

Post by Shalex » Thu 04 Mar 2021 14:18

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.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: How to configure navigation property naming format?

Post by RobertK » Fri 05 Mar 2021 04:47

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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: How to configure navigation property naming format?

Post by Shalex » Fri 05 Mar 2021 13:19

There is no such option currently. We will investigate the question.

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: How to configure navigation property naming format?

Post by RobertK » Sat 05 Jun 2021 07:48

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")

RobertK
Posts: 111
Joined: Thu 02 Mar 2017 05:44

Re: How to configure navigation property naming format?

Post by RobertK » Sat 05 Jun 2021 13:10

Ideally would want this navigation properties naming pattern
(example only, does not represent a realworld database design)

Image

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: How to configure navigation property naming format?

Post by Shalex » Mon 07 Jun 2021 14:39

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.

Post Reply