Is it possible to have an association mapping a table to itself?
e.g.
Table:
ConditionId
ConditionName
...
...
ParentConditionId
where we can have many ParentConditionIds each mapping to the same ConditionId.
I've tried a one to many mapping but I'm getting an error when there is no children.
You can create such a relationship by defining a third table, called a junction table, whose primary key consists of the foreign keys from both table A and table B.
Entity framework supports three types of relationships, same as database: 1) One-to-One 2) One-to-Many, and 3) Many-to-Many.
Once you have a table in Word, you might decide to split that table into two or more tables. This way, you can create smaller tables, or add text in between two tables. Put your cursor on the row that you want as the first row of your second table. In the example table, it's on the third row.
Yes it is possible. Put the FK in your database and the wizard will map it correctly. Make sure ParentConditionId is nullable.
Take a look tutorial which can be download here . It explains in detail how to model self-reference table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With