Consider the following tables:
Base, Primary key: Id
Extension, Primary key: Id
The primary key in the “Extension” table has the same value as the primary key in the “Base” table. I want to model this in the edmx as such:
Base can have 0..1 (Zero or One) instances of Extension.
Extension can have 1 (One) instance of Base. Use Extension.Base to access the Base instance.
When I try to specify the mapping details for this association, I get an error such as this:
“Error 3021: Problem in mapping fragments starting at line xx:Each of
the following columns in table Base is mapped to multiple conceptual
side properties: Base.ID is mapped to “
How can I model a 1:0..1 relationship which is not backed by a database relationship? I basically want a relationship so I can query my read-model using Linq.
If I’m reading you correct then your doing something similar to a problem I had to resolve to too long back in a messeging system.
Basically, I created an intermediate table, with 2 columns in, both ints, 1 held the id from one table, and the other the id from another table, that then allowed me to bridge the two together.
so EG:
I did have to manage the table manually however, so a little extra work, but it did the trick.
Maybe not the exact schema you need, but I think the intermediate table whatever your scheme is a sensible way to look at addressing your needs.