title: The association between entities (with the key value, CreatedById:200) has been severed - Error
body: <p>While I try to delete a ProjectParticipant object from a Project object and call context.SaveChangesAsync(), I get this error:</p>
  <blockquote>
  <p>ERROR: The association between entities ‘employee’ and ‘project’ with the key value ,CreatedById:200 has been severed but the relationship is either marked as ‘required’ or is implicitly required because the foreign key is not billable of the dependent/child entity should be deleted when a required relationship is severed, then setup  the relationship to use cascade deletes.</p>
  </blockquote>
  <p>Could someone help me fix this?</p>
  <p>Project.cs</p>
  <pre><code>        public class Project
          {
              public Project()
              {
                  ProjectParticipants = new HashSet&lt;ProjectParticipant&gt;();
              }
              public int Id { get; set; }
  
              public int CreatedById { get; set; }
  
              public Employee CreatedBy { get; set; }
  
              public virtual ICollection&lt;ProjectParticipant&gt; ProjectParticipants { get; set; }
          }
          }
  </code></pre>
  <p>Employee.cs</p>
  <pre><code>        public class Employee
          {
              public Employee()
              {
                  Projects = new HashSet&lt;Project&gt;();
                  ProjectParticipants = new HashSet&lt;ProjectParticipant&gt;();
              }
              public int Id { get; set; }
              public virtual ICollection&lt;Project&gt; Projects { get; set; }
              public virtual ICollection&lt;ProjectParticipant&gt; ProjectParticipants { get; set; }
          }
  </code></pre>
  <p>ProjectParticipant.cs</p>
  <pre><code>        public class ProjectParticipant
          {
              public ProjectParticipant()
              {
              }
              public int Id { get; set; }
              public int ProjectId { get; set; }
              public virtual Project Project { get; set; }
              public int EmployeeId { get; set; }
              public virtual Employee Employee { get; set; }
          }
  </code></pre>
  <p>ProjectDBContext.cs</p>
  <pre><code>        public class ProjectDBContext:DBContext
          { 
              public override OnModelCreating(ModelBuilder modelBuilder)
              {
                  modelBuilder.Entity&lt;Project&gt;(entity =&gt; { 
                      ...
                      entity.HasOne(d =&gt; d.CreatedBy)
                      .WithMany(a =&gt; a.Projects)
                      .HasForeignKey(d =&gt; d.CreatedById)
                      .OnDelete(DeleteBehavior.ClientSetNull)
                      .HasConstraintName(&quot;FK_Project_Employee_CreatedBy&quot;);
                      ...
                  });
  
                  modelBuilder.Entity&lt;ProjectParticipant&gt;(entity =&gt; {
                      ...
                      entity.HasOne(d =&gt; d.Employee)
                      .WithMany(a =&gt; a.ProjectParticipants)
                      .HasForeignKey(d =&gt; d.EmployeeId)
                      .OnDelete(DeleteBehavior.Cascade)
                      .HasConstraintName(&quot;FK_ProjectParticipants_Employee&quot;);
  
                     entity.HasOne(d =&gt; d.Project)
                    .WithMany(a =&gt; a.ProjectParticipants)
                    .HasForeignKey(d =&gt; d.ProjectId)
                    .OnDelete(DeleteBehavior.Cascade)
                    .HasConstraintName(&quot;FK_ProjectParticipants_Project&quot;);
                      ...
                  });
  
                  modelBuilder.Entity&lt;Employee&gt;(entity =&gt; {
                      ...
                  });
              }
          }
  </code></pre>