title: Can I have a child collection linked by more than one relationship?
body: <p>I have some entities that can be associated with each other. A simple pair of classes to do this would ideally look like:</p>
  
  <pre><code>public class linkableEntity
  {
      public int Id { get; set;} 
  
      public virtual ICollection&lt;Link&gt; Links { get; set; }
  }
  
  public class Link
  {
      public int Id { get; set; }
  
      public int SomeProperty { get; set; }
  
      public int entity1Id { get; set; }
      public virtual LinkableEntity entity1 { get; set;}
  
      public int entity2Id { get; set; }
      public virtual LinkableEntity entity2 { get; set;}
  }
  </code></pre>
  
  <p>With tables something like:</p>
  
  <pre><code>Table linkableEntity
  Column Id
  
  Table link
  Column entityId1 - foreign key to linkableEntity.Id
  Column entityId2 - foreign key to linkableEntity.Id
  Column someProperty
  </code></pre>
  
  <p>Having tried this out, and looking at this question: <a href="https://stackoverflow.com/questions/5559043/entity-framework-code-first-two-foreign-keys-from-same-table">Entity Framework Code First - two Foreign Keys from same table</a> I don't think that what I want to do was possible in EF4, has anything changed in EF6 that would make this possible? (I haven't found any more recent questions addressing this subject)</p>
  
  <p>If not, is there a better way of representing this than changing linkableEntity to something like:</p>
  
  <pre><code>public class linkableEntity
  {
      public int Id { get; set;} 
  
      public virtual ICollection&lt;Link&gt; LinksWhereFirst { get; set; }
      public virtual ICollection&lt;Link&gt; LinksWhereSecond { get; set; }
  }
  </code></pre>
  
  <p>and then dealing with the mess?</p>