title: LinqToSQL removing specific child nodes from a list of parent nodes
body: <p>I have an <code>ObservableCollection</code> of recipes, and each recipe has an <code>ObservableCollection</code> of ingredients.  Let's say that I'm wanting to modify or remove a certain ingredient from all of the recipes (for instance, to remove peanuts from all of the recipes) using Linq.  I have tried doing something like this:</p>
  
  <pre><code>foreach(Recipe r in myObservableRecipes) 
  {
      r.ObservableIngredients.RemoveAll(i =&gt; i.Type == PEANUTS);
  }
  </code></pre>
  
  <p>This doesn't work though because the ingredients list is an ObservableCollection and <code>RemoveAll</code> is a <code>List&lt;T&gt;</code> method.  If I add <code>ToList().RemoveAll()</code> it doesn't actually remove them from the collection, but removes them from a copy of the collection.  I can't find a Remove Where combination that seems to work, as Where returns an <code>IEnumerable</code> which does not have a <code>Remove</code> call.</p>
  
  <p>What I'm doing is:</p>
  
  <pre><code>foreach(Recipe r in myObservableRecipes)
  {
      var ingToRemove = new HashSet&lt;Ingredient&gt;(r.myObservableIngredients.Where(i =&gt; i.Type == PEANUTS));
      foreach (Ingredient i in r.myObservableIngredients.ToList())
      {
          if(ingToRemove.Contains(i)) r.myObservableIngredients.Remove(i);
      }
      RaisePropertyChangedEvent("myObservableIngredients");
  }
  </code></pre>
  
  <p>This works but seems clunky where the intersection of the entity sets and observable collections are.  I'm actually also removing the same entity from the entity set (<code>DeleteOnSubmit</code>) inside the same loop, and then calling submit changes.  Is this the design intent for using <code>LinqToSQL</code> entities with WPF and the <code>ObservableCollections/CollectionViewSource</code> paradigm?</p>