title: Insert operation with many-to-many relationship using EF
body: <p>I've two model classes:</p>
  
  <pre><code>public class Candidate
  {
    public int Id { get; set; }
    public string Name { get; set; }
    public ICollection&lt;Job&gt; Jobs { get; set; }
  }
  
  public class Job
  {
    public int Id { get; set; }
    public string Name { get; set; }
    public ICollection&lt;Candidate&gt; Candidates { get; set; }
  }
  </code></pre>
  
  <p>My DbContext name is JobsContext.</p>
  
  <p>The above code generates me 3 tables Candidates, Jobs &amp; CandidatesJobs(autogenerated by EF)</p>
  
  <p>Now I've records in Jobs table : Id = 1, Name = "Sales" : Id = 2, Name = "Engineer".</p>
  
  <p>I want to associate a new Candidate which I'll be inserting into Candidates table with the 2 records from Jobs table.</p>
  
  <p>Before inserting the Candidate I know the Id's of the Jobs table &amp; I don't wish to make a call to the database to get more details from Jobs table.</p>
  
  <p>How do I do this using Entity Framework 5?</p>