title: How to update a navigation collection property
body: <p>I simply would like to update the customer and one of his orders using Entity Framework 6. I tried this but it is updating the customer only not his orders:</p>
  
  <pre><code>Customer customer = db.Cutomers.Include(x =&gt; x.Orders).Where(y =&gt; y.Id  ==1234).SingleOrDefault();
  customer.Name = "Joe";              //  changing the customer name
  customer.Orders[0].OrderDesc = "NewDesc";  //  changing one of the orders
  customer.Orders[0].OrderDate = DateTime.Now;
  
  using (var db = new Context())
  {      
         db.Cutomers.Attach(customer);
         db.Entry(customer).Collection(e =&gt; e.Orders).Load();
         db.Entry(customer).State = EntityState.Modified;   
         db.SaveChanges();
  }
  </code></pre>