title: Query a many-to-many relationship with linq/Entity Framework. CodeFirst
body: <p>How can I query a many-to-many relationship using Entity Framework code first and linq? The problem is that EF create automatically the relation table. So, I don't have it in my context.</p>
  
  <p>This is the relational model:</p>
  
  <p><img src="https://i.stack.imgur.com/Bz4tB.png" alt="enter image description here"></p>
  
  <p>I need a list of Articles for a specific Category_Id, basically replicate something like that:</p>
  
  <pre><code>select a.Id, a.Title,a.ShortDescription                       
  from Articles a
  join CategoryArticles ca on ca.Article_Id=a.Id
  where ca.Category_Id  = @parameter
  </code></pre>
  
  <p>However my dbcontext only have :</p>
  
  <pre><code>public DbSet&lt;Article&gt; Articles { get; set; }
  public DbSet&lt;Category&gt; Categories { get; set; }.
  </code></pre>
  
  <p>Thanks for any help.</p>