'Add Foreign Key Property to..' checkbox disabled for 0..1 to 1 relationships

459 views Asked by At

On the model-first approach in the designer, if I create a relationship where the cardinality on one end of the relationship is '0..1' and '1' on the other, the designer disables the 'Add Foreign Key Property to..' checkbox.

For example, say that I had an Order entity and an OrderQuantity entity, where the OrderQuantity entity simply stipulates the initial amount of Order entities available, but doesn't have to be specified. Thus an Order can have 0 or 1 OrderQuantity, and an OrderQuantity will always have 1 Order.

The same applies if I am trying to make an entity refer to previous and newer versions of itself (i.e. a node in a list).

Defining this relationship, the designer will not allow me to add foreign key properties at all, and I have to rely on the navigation methods (which are generated fine).

Has anyone else experienced this?

1

There are 1 answers

0
Mauro On

change the target framework of your solution to. .Net Framework 4.0