title: EF6 One to Many and Many to One between same entities
body: <p>I'm trying to create a double relationship. Lets say its a Team and Players - a Team has many Players but only one captain</p>
  
  <pre><code>    public class Team
      {
          public int Id { get; set; }
          public virtual ICollection&lt;Player&gt; Players { get; set; }
  
          public Player Captain { get; set; }
          public int CaptainId { get; set; }
      }
  
  
      public class Player
      {
          public int Id { get; set; }
          public string Name { get; set; }
  
          [InverseProperty("Players")]
          public virtual Team Team { get; set; }
          public int TeamId { get; set; }
      }
  </code></pre>
  
  <p>When running update-database this is resulting in an error along the lines of 
  The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_dbo.Teams_dbo.Players_TeamId". The conflict occurred in database "dev", table "dbo.Players", column 'Id'. (I'm translating from my real classnames/fields)</p>