title: Code first Many to Many Constraint error
body: <p>I have the following fluent mapping:</p>
  
  <pre><code> modelBuilder.Entity&lt;User&gt;()
                  .HasMany&lt;Device&gt;(user =&gt; user.Devices)
                  .WithMany(sv =&gt; sv.Users)
                  .Map(userDevice =&gt;
                  {
                      userDevice.MapLeftKey("UserId");
                      userDevice.MapRightKey("DeviceId");
                      userDevice.ToTable("UserDevice"));
                  });
  </code></pre>
  
  <p>Inside User:</p>
  
  <pre><code>public virtual ICollection&lt;Device&gt; Devices { get; set; }
  </code></pre>
  
  <p>Inside Device:</p>
  
  <pre><code>public virtual ICollection&lt;User&gt; Users { get; set; }
  </code></pre>
  
  <p>Now I receive the following error:</p>
  
  <blockquote>
    <p>{"Introducing FOREIGN KEY constraint
    'FK_dbo.UserDevice_dbo.Device_DeviceId' on table 'UserDevice' may
    cause cycles or multiple cascade paths.  Specify ON DELETE NO ACTION
    or ON UPDATE NO ACTION, or modify other FOREIGN KEY
    constraints.\r\nCould not create constraint. See previous errors."}</p>
  </blockquote>
  
  <p>I would love to set "WillCascadeOnDelete(false)" but this option is not available on "WithMany()"</p>
  
  <p>I also found the following solution but I do not want to disable cascade delete completely:
  <a href="https://stackoverflow.com/questions/11779611/entity-framework-many-to-many-cascade-delete-issue">Entity Framework Many to Many Cascade Delete Issue</a></p>