title: EF6, Circular dependency givs DbPpdateException
body: <p>I'm using Entity Framwork 6, code first.</p>
  
  <p>I have an entity <strong>Team</strong> that has a list of <strong>Members</strong> where one <strong>Member</strong> is the <strong>team leader</strong>.</p>
  
  <pre><code>public class Team
  {
      public virtual List&lt;Member&gt; Members { get; private set; }
      public virtual Member TeamLeader { get; private set; }
  
      public Team()
      {
          Members = new List&lt;Member&gt;();
      }
  
      public AddMember(Member member)
      {
          Members.Add(member);
      }
  
      public AddTeamLeader(Member teamLeader)
      {
          TeamLeader = teamLeader;
          AddMember(teamLeader);
      }
  }
  </code></pre>
  
  <p>I want to do the following but it throws DbUpdateException.</p>
  
  <pre><code>using(var uow = new UnitOfWork((new DataContext())))
  {
      var team = new Team();
      team.AddMember(new Member("Adam"));
      team.AddTeamLeader(new Member("David"));
  
      uow.Teams.Add(team);
      uow.Complete();
  }
  </code></pre>
  
  <p>This works but its not nice and some day someone will write the first version..</p>
  
  <pre><code>using(var uow = new UnitOfWork((new DataContext())))
  {
      var theTeamLeader = new Member("David");
      uow.Members.Add(theTeamLeader);
      uow.Complete();
  
      var team = new Team();
      team.AddMember(new Member("Adam"));
      team.AddTeamLeader(theTeamLeader);
  
      uow.Teams.Add(team);
      uow.Complete();
  }
  </code></pre>
  
  <p>Is it possible to create a complete team with members and a leader and save that to the database with only one SaveChanges?</p>
  
  <p>The member table will have a foreign key to the Team table and the Team table will have a foreign key to the member table so it's a circular dependency and therefore I get an DbUpdateException.</p>