title: How to use DBContext.Add/Attach (using EF CodeFirst 4.1) with nested opbjects
body: <p>Problem: When adding an object "Order" to my dbcontext, all nested objects of the order gets "readded" to the database, though the nested objects is static data and only a reference shoudl be added in the database.</p>
  
  <p>Example:
  The database holds 0 orders, and 3 items.</p>
  
  <p>I add one order with 2 items.</p>
  
  <p>Now the database hold 1 order, and 5 items. The two items in the order has been "readded" to the database, even though the items had the right primary keys before db.SaveChanges().</p>
  
  <p>I realize that i may be able to attach the existing items to the dbcontext before saving changes, but is that really the only way to go? Can't EF figure out that to item already exists when the primary key matches an existing item?</p>
  
  <p>Does anyone know if this is different in the new version of EF CodeFirst?</p>