title: Entity Framework Many To Many Issues
body: <p>I have a Many To Many Relationship using a linking table which contains additional information. 3 Entities ,LHS, RHS, LHSRHS
  LHS 1 - * with LHSRHS
  RHS 1 - * with LHSRHS</p>
  
  <p>I use the designer to generate EDMX based on the tables</p>
  
  <p>I have 2 issues
  1) If a create all 3 entities (new ones) link them up and try to persist i get a FK violation as it tries to insert into the LHSRHS tables before inserting into the RHS table</p>
  
  <p>2) If I load a LHS object from the DB, then try to create a RHS object and link it to the LHS object i get a FK violation. 
  If I load a RHS object from the DB, then try to create a LHS object and link it to the RHS object i works perfectly.</p>
  
  <p>CODE for this :</p>
  
  <pre><code>        //WORKS
          eftestEntities es = new eftestEntities();
          RHS existing = es.RHS.First();
  
          LHS newObject = new LHS();
          newObject.ID = "LHs1";
          newObject.Name = "LHs1";
          LHSRHS link = new LHSRHS();
  
          link.Something = "some";
  
          link.LHS = newObject;
  
          existing.LHSRHS.Add(link);
  
          es.SaveChanges();
  
          ...........
  
          //DOES NOT WORK
          eftestEntities es = new eftestEntities();
          LHS existing = es.LHS.First();
  
          RHS newObject = new RHS();
          newObject.ID = "RHSNEW1";
          newObject.Name = "RHSNEW";
          LHSRHS link = new LHSRHS();
  
          link.Something = "some";
  
          link.RHS = newObject;
  
          existing.LHSRHS.Add(link);
  
          es.SaveChanges();
  </code></pre>
  
  <p>Anyone have any ideas ?</p>