title: NullReferenceException on join with Postgres EF Provider
body: <p>I have a postgres database and using asp.net core mvc (+ ef). The database is created correctly. I have two tables 'Module' and 'ModuleMenu'. I want to get all the menu's for a given module but I keep on failing to create the linq query.</p>
  
  <p>Situation</p>
  
  <p><strong>Model: Module.cs</strong></p>
  
  <pre><code>namespace project.Model
  {
      public class Module
      {    
          [Required]
          public string ID { get; set; }
  
          [Required]
          public string Name { get; set; }
  
          [Required]
          public string Description { get; set; }
      }
  }
  </code></pre>
  
  <p><strong>Model: ModuleMenu.cs</strong></p>
  
  <pre><code>namespace project.Models
  {
      public class ModuleMenu
      {
          [Required]
          public string ID { get; set; }
  
          public int ModuleID { get; set; }
  
          [Required]
          public string Title { get; set; }
  
          [ForeignKey("ModuleID")]
          public virtual Module Module { get; set; }
      }
  }
  </code></pre>
  
  <p><strong>ApplicationDbContext.cs</strong></p>
  
  <pre><code>namespace project.Data
  {
      public class ApplicationDbContext
      {
          public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options)
              : base(options)
          {
          }
  
          protected override void OnModelCreating(ModelBuilder modelBuilder)
          {
              base.OnModelCreating(modelBuilder);
          }
  
  
          public DbSet&lt;Module&gt; Modules { get; set; }
  
          public DbSet&lt;ModuleMenu&gt; ModuleMenus { get; set; }
      }
  }
  </code></pre>
  
  <p><strong>Query</strong></p>
  
  <pre><code>public List&lt;ModuleMenu&gt; GetModuleMenus(){
      var query = from m in _dbContext.ModuleMenus
                  join mod in _dbContext.Modules on 
                      m.ModuleID equals mod.ID
                  select m;
  
      return query.ToList();
  }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
        An exception was thrown attempting to execute the error handler.
  System.NullReferenceException: Object reference not set to an instance of an object.
  </code></pre>
  
  <p>Can anyone help me to correctly create the query?</p>