I'm using Entitiy Framework 6.1.3 and I want to add a relation from N tables to 1 table with more than 1 join columns. The following example will help you to understand my problem:
Table P (protocol table) with these columns:
protocol_id (int, PK)
message (string)
module (string)
reference_id (int)
protocol_id | module | message | reference_id
-----------------------------------
1 | A | created | 1
2 | A | modified | 1
2 | A | created | 2
3 | B | deleted | 1
4 | B | modified | 1
Table A (module A table) with these columns:
mod_id (int, PK)
mod_x (string)
mod_y (...)
...
mod_id | mod_x | ...
--------------------
1 | abc | ...
2 | xyz | ...
Table B (module B table) with these columns:
mod_id (int, PK)
mod_x (string)
mod_y (...)
...
mod_id | mod_x | ...
--------------------
1 | abc | ...
2 | xyz | ...
I would like to have a navigation property in module A to get all procotols for this row - sthg like that:
where module = 'A' and reference_id = mod_id
(same for module B, module C ...)
In Java/Hibernate, I know you can use more than one ElementJoinColumns (with referenceColumnsNames, ...).
How can I handle this with EF6.1? Thanks, Markus.