title: EF 6 'Bulk' insert with FK relationed models
body: <p>I am trying to bulk insert using EF (model first) on two tables that have a FK relationship (one to many). The code below properly inserts all of the Challenge entries but only inserts the X amount Shortages one time. My expectation... I have 10 shortages with 2 challenges. I should receive 2 challenge entries and 20 shortage entries. I am only seeing 10 challenge entries for the first shortage inserted. (the code below is simplified)</p>
  
  <pre><code>//class for cloning Shortage collection
  public class ShortageCollection : Collection&lt;Shortage&gt;
      {
          public ShortageCollection(IList&lt;Shortage&gt; source) : base(source) { }
  
          public ShortageCollection() { }
  
          public ShortageCollection Clone()
          {
              return Clone(this);
          }
          public static ShortageCollection Clone(ShortageCollection shortage)
          {
              var res = new ShortageCollection();
              foreach (var s in shortage)
              {
                  res.Add(s.Clone());
              }
          }
      }
  
   public class Shortage : StandardDB.Shortage
      {
         public Shortage Clone()
          {
              return new Shortage()
              {
                  PART_NUMBER = this.PART_NUMBER,
                  Note = this.Note,
                  Qty = this.Qty,
                  ResponseMachine = this.ResponseMachine
              };
          }
      }
  
  public void CreateChallenge()
      {
          var JSONJobs = new JavaScriptSerializer().Deserialize&lt;string[]&gt;(Jobs);
          var JSONParts = new JavaScriptSerializer().Deserialize&lt;ChallengePartsList[]&gt;(Parts);
          using (ARTEntities art = new ARTEntities())
          {
              art.Configuration.AutoDetectChangesEnabled = false;
              art.Configuration.ValidateOnSaveEnabled = false;
  
              ShortageCollection sColl = new ShortageCollection();
              foreach(var part in JSONParts)
              {
                  Shortage s = new Shortage()
                  {
                      PART_NUMBER = part.Invid,
                      Note = Challenge,
                      Qty = part.Qty,
                      ResponseMachine = ResponseMachine
                  };
                  sColl.Add(s);
              }
  
              foreach (var job in JSONJobs) {
                  Challenge c = new Challenge()
                  {
                      InitiatorORG = Org,
                      TypeID = TypeID,
                      DISCRETE_JOB = job,
                      InitiatorPERSON_ID = InitiatorPersonID,
                      InitiatedDate = datenow,
                      Challenge1 = Challenge,
                      ChampionGroupID = ChampionGroupID,
                      StatusID = StatusID,
                      InitiatorGroupID = InitiatorGroupID,
                      DivisionID = DivisionID,
                      Shortages = sColl.Clone()
                  };
                  art.Challenges.Add(c);
              }
              art.SaveChanges();
          }
      }
  </code></pre>