title: Microsoft.EntityFrameworkCore ProjectTo() Method definition not found for my repository
body: <p>I have just started working with databases and Entity Framework for the first time in C# and I am trying to get all the data out of my database right now but I can't seem to use the <code>ProjectTo&lt;T&gt;()</code> method in my method I am writing. It does not show up in my autocomplete on VS Studio and throws me the error</p>
  <blockquote>
  <p>IIncludableQueryable&lt;User, DateTime&gt;' does not contain a definition for 'ProjectTo' and no accessible extension method 'ProjectTo' accepting a first argument of type 'IIncludableQueryable&lt;User, DateTime&gt;' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  <p>So I was wondering if anyone knew how to fix this? Thanks for your help in advance</p>
  <p>Here is my code:</p>
  <p>UserRepository.cs:</p>
  <pre><code>using GraphQL.Introspection;
  using Microsoft.EntityFrameworkCore;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  
  namespace AppName.GraphQL
  {
      public class UserRepository
      {
          private readonly UserDBContext userDBContext;
  
          public UserRepository(UserDBContext userDBContext)
          {
              this.userDBContext = userDBContext;
          }
  
          //GET request to get all the users from the db
          public async Task&lt;List&lt;T&gt;&gt; GetAll&lt;T&gt;()
          {
              return await userDBContext
                  .Users
                  .Include(x =&gt; x.Id)
                  .Include(x =&gt; x.Username)
                  .Include(x =&gt; x.Password)
                  .Include(x =&gt; x.Email)
                  .Include(x =&gt; x.DateOfBirth)
                  .Include(x =&gt; x.DateCreated)
                  .ProjectTo&lt;T&gt;()//throws the error
                  .ToListAsync();
          }
  
          public async Task&lt;IEnumerable&lt;User&gt;&gt; GetAll()
          {
              return await userDBContext
                  .Users
                  .Include(x =&gt; x.Id)
                  .Include(x =&gt; x.Username)
                  .Include(x =&gt; x.Password)
                  .Include(x =&gt; x.Email)
                  .Include(x =&gt; x.DateOfBirth)
                  .Include(x =&gt; x.DateCreated)
                  .ToListAsync();
          }
      }
  }
  </code></pre>
  <p>UserContext.cs</p>
  <pre><code>namespace AppName.GraphQL
  {
      public class UserDBContext : DbContext
      {
          public static string DbConnectionString = &quot;mongodb://localhost:27020/PetPetOnline&quot;;
          
          public UserDBContext(DbContextOptions&lt;UserDBContext&gt; options) : base(options) { }
  
          public DbSet&lt;User&gt; Users { get; set; }
  
          protected override void OnModelCreating(ModelBuilder modelBuilder)
          {
              modelBuilder.Entity&lt;User&gt;().HasData(new User(ObjectId.GenerateNewId(),&quot;Jon&quot;, &quot;abadpassword&quot;, &quot;jon@PetPetOnline.xyz&quot;, DateTime.ParseExact(&quot;1998-01-16 00:00:00,000&quot;, &quot;yyyy-MM-dd HH:mm:ss,fff&quot;, System.Globalization.CultureInfo.InvariantCulture), DateTime.Now));
              base.OnModelCreating(modelBuilder);
          }
      }
  } 
  </code></pre>
  <p>and User.cs</p>
  <pre><code>public class User
  {
      [Key]
      public  ObjectId Id { get; set; }
  
      [Required]
      [StringLength(100)]
      public string Username { get; set; }
  
      [Required]
      [StringLength(200)]
      public string Password { get; set; }
  
      [Required]
      [StringLength(200)]
      public string Email { get; set; }
  
      [Required]
      public DateTime DateOfBirth { get; set; }
  
      public DateTime DateCreated { get; set; }
  
      public User(ObjectId id, string username, string password, string email, DateTime dateOfBirth, DateTime dateCreated)
      {
          Id = id;
          Username = username;
          Password = password;
          Email = email;
          DateOfBirth = dateOfBirth;
          DateCreated = dateCreated;
      }
  }
  </code></pre>