title: EF core many to many configuration not working with Fluent API
body: <p>I am having trouble with understanding and implementing a many to many repationship using the FLuent API and EF Core.</p>
  
  <p>I have looked at <a href="https://stackoverflow.com/questions/8927278/how-to-configure-many-to-many-relationship-using-entity-framework-fluent-api">this</a> question and set up my relationship exactly as that but I am getting the following error:</p>
  
  <blockquote>
    <p>Error CS1061  'CollectionNavigationBuilder' does not contain a definition for 'WithMany' and no extension method 'WithMany' accepting a first argument of type 'CollectionNavigationBuilder' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>This is my intention.  I have a client who has many jobs. I should be able to get all the jobs linked to that client. EF should create the join table in the background...</p>
  
  <p>Here are my classes:</p>
  
  <pre><code>public class Client : IEntityBase
  {
      public int Id { get; set; }
  
      public int? JobId { get; set; }
      public ICollection&lt;Job&gt; Jobs { get; set; }
  }
  
  public class Job : IEntityBase
  {
      public int Id { get; set; }
  }
  
  //my interface
  public interface IEntityBase
  {
      int Id { get; set; }
  }
  </code></pre>
  
  <p><strong>EDIT</strong> Here is the Fluent API I tried and where I get the error on the ".withMany"</p>
  
  <pre><code>        modelBuilder.Entity&lt;Client&gt;()
              .HasMany(p =&gt; p.Jobs)
              .WithMany(p =&gt; p.clients)
              .Map(m =&gt;
              {
                  m.MapLeftKey("ClientId");
                  m.MapRightKey("JobId");
                  m.ToTable("ClientJob");
              });
  </code></pre>
  
  <p>I am using a generic repository pattern as per Chris Sakell's blog.  Here is the code for retrieving clients:</p>
  
  <pre><code>        IEnumerable&lt;Client&gt; _clients = _clientRepository
             .AllIncluding(s =&gt; s.Creator, s =&gt; s.Jobs, s =&gt; s.State)
             .OrderBy(s =&gt; s.Id)
             .Skip((currentPage - 1) * currentPageSize)
             .Take(currentPageSize)
             .ToList();
  </code></pre>
  
  <p>and I am using the generic code as per:</p>
  
  <pre><code>    public virtual IEnumerable&lt;T&gt; AllIncluding(params Expression&lt;Func&lt;T, object&gt;&gt;[] includeProperties)
      {
          IQueryable&lt;T&gt; query = _context.Set&lt;T&gt;();
          foreach (var includeProperty in includeProperties)
          {
              query = query.Include(includeProperty);
          }
          return query.AsEnumerable();
      }
  </code></pre>
  
  <p>How do I configure this so I can retrieve the jobs as well using the includeproperty as per the Allincluding statement above?</p>