title: An item with the same key has already been added in Entity Framework
body: <p>I have table with 2 foreign keys. when I am trying to insert duplicate value (for foreign keys) it gives erroe says "An item with the same key has already been added"</p>
  
  <p>below is my code</p>
  
  <pre><code>CheckListTrack CheckListtrack = new CheckListTrack();
  trackId = entityCollection.WorkItemTrack.Max(p =&gt; p.TrackID) ;
  foreach (int ListID in tracklist)
  {
      CheckListtrack.WorkItemTrackReference.EntityKey = new EntityKey("SEIESSEntities.WorkItemTrack", "TrackID", trackId);   // foreign key
  
      CheckListtrack.CheckListReference.EntityKey = new EntityKey("SEIESSEntities.CheckList", "CheckListID", ListID);     // foreign key
  
      entityCollection.AddToCheckListTrack(CheckListtrack); // error comes after second time control passes here
  
      }
      curentScope.Complete();
      success = true;
  </code></pre>
  
  <p>Please help me</p>