title: Entity Framework Cascade delete - FOREIGN KEY constraint
body: <p>I have a problem with the following model:</p>
  
  <pre><code>public class ProjectPage
  {
      [Key]
      public Guid Id { get; set; }
  
      public Guid? HeaderId { get; set; }
      public ProjectPage Header { get; set; }
  
      public Guid? FooterId { get; set; }
      public ProjectPage Footer { get; set; }
  }
  </code></pre>
  
  <p>On model Creating I have this:</p>
  
  <pre><code>modelBuilder.Entity&lt;ProjectPage&gt;().HasOptional(p =&gt; p.Header).WithMany().HasForeignKey(p =&gt; p.HeaderId).WillCascadeOnDelete(true);
  modelBuilder.Entity&lt;ProjectPage&gt;().HasOptional(p =&gt; p.Footer).WithMany().HasForeignKey(p =&gt; p.FooterId).WillCascadeOnDelete(true);
  </code></pre>
  
  <p>But I can't update database. I've got the following error in the Package Manager console:</p>
  
  <blockquote>
    <p>Introducing FOREIGN KEY constraint
    'FK_dbo.ProjectPages_dbo.ProjectPages_FooterId' on table
    'ProjectPages' may cause cycles or multiple cascade paths. Specify ON
    DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY
    constraints.</p>
  </blockquote>
  
  <p>Can somebody explain how to remove the Project Page (which can be Footer or Header in another Project Page)?</p>