title: How to create two navigation properties to one model (EF6 Code First)
body: <p>Using EF6 Code First convention, I want to create model with two foreign keys to the same table. For instance, now I have <strong>Team</strong> model:</p>
  
  <pre><code>public class Team
  {
      public Guid Id { get; set; }
      public String Name { get; set; }
  
      public virtual ICollection&lt;Match&gt; Matches { get; set; }
  }
  </code></pre>
  
  <p>and <strong>Match</strong> model:</p>
  
  <pre><code>public class Match
  {
      public Guid Id { get; set; }
      public Int32 TeamHomeScore { get; set; }
      public Int32 TeamAwayScore { get; set; }
  
      public Guid TeamHomeId { get; set; } // I want these properties to be foreign keys
      public Guid TeamAwayId { get; set; } //
  
      public virtual Team TeamHome { get; set; }
      public virtual Team TeamAway { get; set; }
  }
  </code></pre>
  
  <p>But after project running I've got next exception:</p>
  
  <blockquote>
    <p>Introducing FOREIGN KEY constraint 'FK_dbo.Matches_dbo.Teams_TeamHomeId' on table 'Matches' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
    Could not create constraint.</p>
  </blockquote>
  
  <p>Any recommendations ?</p>