title: Unable to attach multiple entities for insertion (An object with the same key already exists in the ObjectStateManager)
body: <p>I have an entity that contains a list of other entities.  The list of entities contains a primary key (identity), foreign key and a string.  When I try to attach the parent entity, I get the exception <code>An object with the same key already exists in the ObjectStateManager. The ObjectStateManager cannot track multiple objects with the same key</code>.</p>
  
  <p>For some reason the Entity Framework (EF) thinks that this is a duplicate record.  The records <em>do have the same foreign key</em>, but property that is the primary key (Id of type int) is set to 0 which, from my understanding, is acceptable since the column is an identity column.</p>
  
  <p>Does anyone know what I'm doing wrong here?</p>