title: MVC Code First - cascade delete 1 to 1 relationship
body: <p>I have a <code>User</code> and <code>Profile</code> Entity which they have 1-1 relation.<br/></p>
  
  <p><strong>User Entity and configurations</strong></p>
  
  <pre><code>public class User
  {
      public int ID { get; set; }
      public virtual Profile Profile { get; set; }
  }
  
  public class UserConfig : EntityTypeConfiguration&lt;User&gt;
  {
      public UserConfig()
      {
          HasRequired(x =&gt; x.Profile).WithRequiredPrincipal(x =&gt; x.User);
      }
  }
  </code></pre>
  
  <p><strong>Profile Entity and configs</strong></p>
  
  <pre><code>public class Profile
  {
      public int ID { get; set; }
      public virtual User User { get; set; }
  }
  
  public class ProfileConfig : EntityTypeConfiguration&lt;Profile&gt;
  {
      public ProfileConfig()
      {
          HasRequired(x =&gt; x.User).WithRequiredDependent(x =&gt; x.Profile).Map(x =&gt; x.MapKey("UserID")).WillCascadeOnDelete(true);
      }
  }
  </code></pre>
  
  <p>However when I try to delete a list of users I get this exception below :<br/></p>
  
  <pre><code>List&lt;User&gt; users = _user.Where(x =&gt; m.SelectedUsersID.Contains(x.ID)).ToList();
  users.ForEach(x =&gt; _user.Remove(x));
  </code></pre>
  
  <p><code>A relationship from the 'Profile_User' AssociationSet is in the 'Deleted' state. Given multiplicity constraints, a corresponding 'Profile_User_Source' must also in the 'Deleted' state.</code></p>
  
  <p>I've got no idea what is wrong, please help :) </p>