title: Update Many-to-Many Association with GraphDiff
body: <p>I have the following data model:</p>
  
  <p><img src="https://i.stack.imgur.com/F7iUq.png" alt="Data Model"></p>
  
  <p>My business logic works with detached entities so I'm using GraphDiff to perform updates. I'm having trouble updating the PerfModes/CalcPoints association. Conceptually, Block owns CalcPoints and PerfModes, but CalcPoints can be associated with any number of PerfModes.</p>
  
  <p>I'm trying to do updates at the Block level. The code I came up with doesn't throw any errors (while other attempts did) but neither does it update the PerfModes/CalcPoints association.</p>
  
  <pre><code>container.UpdateGraph(block, map =&gt; map
      .OwnedCollection(b =&gt; b.HistPoints)
      .OwnedCollection(b =&gt; b.CalcPoints)
      .OwnedCollection(b =&gt; b.PerfModes, with =&gt; with
          .OwnedCollection(p =&gt; p.FilterCriterion, with2 =&gt; with2
              .OwnedCollection(fc =&gt; fc.Filters, with3 =&gt; with3
                  .AssociatedEntity(f =&gt; f.OperatorType)
                  .AssociatedEntity(f =&gt; f.CalcPoint))))
          .AssociatedCollection(p =&gt; p.CalcPoints)
  );
  </code></pre>
  
  <p>I probably don't have a full grasp of EF graphs and GraphDiff. How do I ensure that the many-to-many PerfModes/CalcPoints association gets updated correctly?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>After looking over andyp's answer, I pulled down the latest version of GraphDiff from GitHub and tried the following mappings:</p>
  
  <pre><code>container.UpdateGraph(block, map =&gt; map
      .OwnedCollection(b =&gt; b.CalcPoints)
      .OwnedCollection(b =&gt; b.PerfModes,
          with =&gt; with.AssociatedCollection(pm =&gt; pm.CalcPoints)));
  </code></pre>
  
  <p>This correctly updates my PerfModes/CalcPoints association. I switched back to my original mappings and still saw the issue of the association not updating, so it seems there's a problem with trying to update the entire model at once. I'd be fine with making multiple UpdateGraph calls, but what would be the best way to break them out?</p>
  
  <p><a href="https://gist.github.com/anonymous/f64e63497ee5bc5ddad1" rel="nofollow noreferrer">Here's</a> a gist with relevant code and a failing unit test.</p>
  
  <p>I'm inheriting the EF generated container class to create my own context with proxy creation disabled. Does that cause a problem with GraphDiff?</p>