title: Entity Framework deleting linked table
body: <p>If I have the following setup</p>
  
  <pre><code>public class Device
  {
      public virtual ICollection&lt;Folder&gt; PresentInFolders { get; set; }
      public virtual RoutingRule RoutingRule { get; set; }
  }
  
  public class Folder
  {
      public virtual ICollection&lt;Device&gt; Devices { get; set; }
  }
  </code></pre>
  
  <p>Is the following code enough to disassociate and delete all linking rows?</p>
  
  <pre><code>foreach (var folder in device.PresentInFolders.ToList())
  {
     folder.Devices.Remove(device);
  }
  device.PresentInFolders.Clear();
  </code></pre>