title: Many-to-many relationship with surrogate key in Entity Framework
body: <p>Entity Framework magically interprets the following table structure as a many-to-many relationship.</p>
  
  <pre><code>table foo (int id)
  table foo_bar (int foo_id, int bar_id)
  table bar (int id)
  </code></pre>
  
  <p>But if the join table has any additional fields it will instead be interpreted as two one-to-many relationships.</p>
  
  <p>I am using a database in which the join table has a surrogate key as primary key. Because of this EF interprets it as two one-to-many relationships.</p>
  
  <pre><code>table foo (int id)
  table foo_bar (int surrogate_pk, int foo_id, int bar_id)
  table bar (int id)
  </code></pre>
  
  <p>Is it possible to modify EF:s interpretation to make it an actual many-to-many relationship in the model? Can it be done using the designer?</p>