title: Delete object and its many-to-many relation
body: <p>I am trying to delete an object that sometimes has a many-to-many relation. The code I use now is:</p>
  <pre><code>db.DeleteObject(registeredDevice);
  db.SaveChanges();
  </code></pre>
  <p>This ofcourse just removes the registeredDevice. But usually this device has a many-to-many  relation to a project in the database. When trying to delete the device in that scenario it will give an error.</p>
  <p><strong>The DELETE statement conflicted with the REFERENCE constraint</strong></p>
  <p>What I need to do is remove the device and its relation (the entry in the many-to-many table, not the project it is related to). How do In do this with LINQ ?</p>