title: Entity framework 7 in ASP.NET MVC6 multiple foreign key to the same table
body: <p>Hi I have the same problem that an old post that is here, the solution offer there doesn't work for me in MVC 6 with EF7 is simple </p>
  
  <pre><code>public class Match
  {
      [Key]
      public int MatchId { get; set; }
  
      public DateTime playday { get; set; }
      public float HomePoints { get; set; }
      public float GuestPoints { get; set; }
  
      public int HomeTeamId { get; set; }
      public int GuestTeamId { get; set; }
  
      [ForeignKey("HomeTeamId")]
      [InverseProperty("HomeMatches")]
      public virtual Team HomeTeam { get; set; }
  
      [ForeignKey("GuestTeamId")]
      [InverseProperty("AwayMatches")]
      public virtual Team GuestTeam { get; set; }
  
  }
  
  public class Team
  {
      public int TeamId { get; set; }
      public String name { get; set; }
  
      public virtual ICollection&lt;Match&gt; HomeMatches { get; set; }
      public virtual ICollection&lt;Match&gt; AwayMatches { get; set; }
  }
  </code></pre>
  
  <p>this is the best way that I found, because I can add a new migration and all is ok, but when I update the database I get an error like this</p>
  
  <blockquote>
    <p>Introducing FOREIGN KEY constraint 'FK_Match_Team_HomeTeamId' on table 'Match' 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 or index. See previous errors.</p>
  </blockquote>