Hi.
I am trying to achieve a one to one mapping in my data. Firstly I set up this relationship in the database by setting one table's primary key as a foreign key into another table.
Entity1.PK <-------- Entity2.PK/FK
Ideablade imports the model and everything seems to work until you try to do an insert Entity1/Entity2 pair in one transaction. An exception is thrown: A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column:Entity1.PK"
A Entity1/Entity2 pair insert within one transaction works fine if you relate them in a one to many fashion though:
Entity2.PK
Entity1.PK <--------- Entity2.FK
... where I presume EntityManger or EF 4.0 first insterts Entity1, extracts its generated PK and use that when inserting Entity2. I'm guessing.
I am assuming this does not work with one to one relationships? Do I have to manually commit entity1, extract its PK so that I can use it to insert Entity2. This makes reject changes more compicated etc etc. What do I do here?