0

I want to create Many-To-Many relationship which allowing me duplicated relations, like this:

A | B
-----
1 | a
1 | a
2 | b
2 | b
etc

But EF create mapping table like this:

AB:
 - AId: PK, FK
 - BId: PK, FK

and this doesn't allow duplicated relations.

How I create mapping table like this:

AB:
 - Id, PK
 - AId: FK
 - BId: FK
Alexey Markov
  • 1,546
  • 2
  • 23
  • 41
  • Why do you need these duplicates? There are [very good reasons *not* to want this.](http://stackoverflow.com/a/32646317/861716) – Gert Arnold May 14 '16 at 22:15
  • I know that the relational database is about `sets` I read that. So I want to has `**PK**`, `FK`, `FK` and get well set. The sing what I want - there is `Patient` and `Procedure`. `Patient` can has multiple same `Procedure` – Alexey Markov May 17 '16 at 04:53
  • The only thing these duplicates tell you is the number of duplicate procedures a patient has been subjected to. Why not just store this number in one record and increment it when necessary? – Gert Arnold May 18 '16 at 15:16

0 Answers0