entity-framework-designer

Entity Framework mapping two table columns to same related table Key

流过昼夜 提交于 2019-12-22 11:29:30
问题 I'm in a situation where I have a table called Elements . Now I'm creating a table called Divergences that will store basically pairs of Elements . The purpose of Divergence is to check if two Elements have diverging answers. Element Divergence --------- ---------- ElementId ElementId1 ElementId2 In the above table schema, ElementId1 and ElementId2 are Foreign Keys mapping to ElementId in Elements table and form the composite primary key for the Divergence table. I use Database First approach

Entity Framework mapping two table columns to same related table Key

怎甘沉沦 提交于 2019-12-05 20:35:47
I'm in a situation where I have a table called Elements . Now I'm creating a table called Divergences that will store basically pairs of Elements . The purpose of Divergence is to check if two Elements have diverging answers. Element Divergence --------- ---------- ElementId ElementId1 ElementId2 In the above table schema, ElementId1 and ElementId2 are Foreign Keys mapping to ElementId in Elements table and form the composite primary key for the Divergence table. I use Database First approach where I create the tables in SQL Server Management Studio and later I do a Update Model from Database.