title: EF Many-to-Many When Class Already Referenced as FK Not Working
body: <p>I am trying to create an Entity Framework <code>many-to-many</code> relationship between <code>People</code> and <code>Penguins</code> in the form of the usual <code>PenguinPeople</code> table holding <code>Person_Id</code> and <code>Penguin_Id</code>. When I generate a migration with the code below, the <code>many-to-many</code> is not created. However, if I comment out the 3 "OwnerId" lines in the Penguin class, the <code>many-to-many</code> works. What gives? They should be independent. </p>
  
  <pre><code>public class Penguin
  {
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public long Id { get; set; }
  
      public long OwnerId{ get; set; } //works if I comment this out
      [ForeignKey("OwnerId")] //works if I comment this out
      public Person Person{ get; set; } //works if I comment this out
  
      public virtual ICollection&lt;Person&gt; PenguinTrainers{ get; set; }
  }
  
  public class Person 
  {
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public long Id { get; set; }
  
      public virtual ICollection&lt;Person&gt; People{ get; set; }
  }
  </code></pre>