views:

171

answers:

2

Is there a way to get ADO.NET Entity to generate 1:1 navigation properties? If I do foreign keys I always get 1:N navigation properties.

A: 

Yes - it's possible. I don't know what to do in the Designer, but try to change the Multiplicity somewer. Sorry! Seldom used the Desinger - working more with code generation.

Arthur
Multiplicity settings are grayed out for me.
jameszhao00
A: 

If I have a foreign key constraint in the database for EntityA like this: FOREIGN KEY (FIELD_X) REFERENCES ENTITYB (FIELD_Y), then when you generated the edmx you should get a single-instance navigational property on EntityA (e.g.: EntityA.EntityB).

FOR
Thing is I want single instance navigation properties on both Entity A and B :)
jameszhao00
hmm I haven't tried it, but applying the FK from A to B and an FK from B to A may just do the trick?
FOR