title: AutoMapper InternalDbSet`1 -> IQueryable`1 Exception
body: <p>I receive the following exception:</p>
  
  <blockquote>
    <p>Mapping types:
    InternalDbSet'1 -> IQueryable'1
    Error mapping types.</p>
  </blockquote>
  
  <p>My AssertConfigurationIsValid() returns valid, however once I run the following function in my transfer layer, the above exception is thrown.</p>
  
  <pre><code>public IQueryable&lt;CategoryDTO&gt; Categories
  {
      get
      {
          return _mapper.Map&lt;IQueryable&lt;CategoryDTO&gt;&gt;(_context.Categories);
      }
  }
  </code></pre>
  
  <p>This is the data access layer function which is called from the above function, where context.Categories is of type DbSet&lt; Category >:</p>
  
  <pre><code>public IQueryable&lt;Category&gt; Categories =&gt; context.Categories.AsQueryable();
  </code></pre>
  
  <p><strong>CategoryDTO:</strong></p>
  
  <pre><code>[AutoMap(typeof(Category), ReverseMap = true)]
  public class CategoryDTO
  {
      public CategoryDTO()
      {
      }
  
      public int Id { get; set; }
  
      [Required]
      public string Description { get; set; }
  
      public int ParentCategoryId { get; set; }
  
      public string ImageFileName { get; set; }
  }
  </code></pre>
  
  <p><strong>Category Entity:</strong></p>
  
  <pre><code>public class Category
  {
      private ILazyLoader LazyLoader { get; set; }
  
      private ICollection&lt;Category&gt; _subcategories;
      private ICollection&lt;Product&gt; _products;
      private Category _parentCategory;
  
      public Category()
      {
  
      }
  
      public Category(ILazyLoader lazyLoader)
      {
          LazyLoader = lazyLoader;
      }
  
      [Key]
      public int Id { get; set; }
  
      [Required]
      public string Description { get; set; }
  
      [ForeignKey("ParentCategory")]
      public int? ParentCategoryId { get; set; }
      public Category ParentCategory
      {
          get =&gt; LazyLoader.Load(this, ref _parentCategory);
          set =&gt; _parentCategory = value;
      }
  
      public ICollection&lt;Category&gt; Subcategories
      {
          get =&gt; LazyLoader.Load(this, ref _subcategories);
          set =&gt; _subcategories = value;
      }
  
      public ICollection&lt;Product&gt; Products
      {
          get =&gt; LazyLoader.Load(this, ref _products);
          set =&gt; _products = value;
      }
  
      public string ImageFileName { get; set; }
  }
  </code></pre>
  
  <p>Any idea where this issue is? The lack of an error in my assertion function has me lost.</p>