title: How to delete entity with all its related entities in a code-first approach
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/937140/delete-an-object-and-all-of-its-related-entities-in-entity-framework">Delete an object and all of its related entities in Entity Framework</a>  </p>
  </blockquote>
  
  
  
  <p>I have looked for a while on how to do this, but found none of the posts addressing this issue.
  These are the classes for setting up the db:</p>
  
  <pre><code>public class Claim
  {
      [Key,DatabaseGenerated(System.ComponentModel.DataAnnotations.DatabaseGeneratedOption.Identity)]
      public int DraftID { get; set; } 
      public int ClaimID { get; set; } 
      public string SupplierCode { get; set; }
      public ClaimStatus Status { get; set; }
      public Policy Policy { get; set; }
  }
  </code></pre>
  
  <p>my context:</p>
  
  <pre><code>public class FnxDbContext:DbContext {
   public FnxDbContext() : base() { this.Configuration.ProxyCreationEnabled = false; } public DbSet&lt;Claim&gt; Claim { get; set; }
  </code></pre>
  
  <p>Now let's say I want to remove the <code>Claim</code>-entity with the DraftID that is "1"
  (there is such a record in the DB with FK to other tables as needed)
  How do I do this? I tried many ideas I found on the net. Most of them talk about a single entity.
  Can anyone help me with this issue?</p>