title: EF 7 beta 6 : Entities with one to many relationships in EF 7
body: <p>I have a very simple model:</p>
  
  <pre><code>class Bag
  {
      public int Id { get; set; }
      public ICollection&lt;RandomThing&gt; RandomThings { get; set; }
  }
  
  class RandomThing
  {
      public int Id { get; set; }
      public String Description{ get; set; }
  }
  </code></pre>
  
  <p>My context's <code>OnModelCreating</code> (in <strong>EF 6</strong>) is something like:</p>
  
  <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder)
  {
      base.OnModelCreating(modelBuilder);
  
      modelBuilder.Entity&lt;Bag&gt;()
          .ToTable("Bag")
          .HasMany(x =&gt; x.RandomThings).WithRequired(x =&gt; x.Bag).WillCascadeOnDelete();
  
      modelBuilder.Entity&lt;RandomThing&gt;().ToTable("RandomThing");
  }
  </code></pre>
  
  <p>As far as I can tell, there is no equivalent way to do this. I know that <a href="http://blogs.msdn.com/b/adonet/archive/2015/07/27/ef7-beta-6-available.aspx" rel="nofollow">cascade deletes are not supported</a>. However, I was wondering, what is the best way to model the one to many relationships as defined in my code example? It seems like all of that stuff has gone (or is yet to be implemented).</p>
  
  <p>I have seen an example (<a href="http://ef.readthedocs.org/en/latest/getting-started/aspnet5.html" rel="nofollow">here</a>) of a <code>DbContext</code> exactly like how I want, but it's actually wrong and doesn't work. If I try to pull down that source code, set up my environment, and do a save on a blog entity with posts, those posts don't get saved as one might imagine.</p>
  
  <p>Are there any workarounds for this?</p>