title: EF Core 2.2 eager loading navigation properties related data problem
body: <p>i am using EF core 2.2 with Postgresql and code first approach.
  these are my classes:</p>
  
  <pre><code>public class SchoolContext : DbContext
  {
      public SchoolContext(DbContextOptions options) : base(options)
      {
      }
  
      public DbSet&lt;Blog&gt; Blogs { get; set; }
      public DbSet&lt;Post&gt; Posts { get; set; }
  
  }
  
  public class Blog
  {
      public int BlogId { get; set; }
      public string Url { get; set; }
  
      public ICollection&lt;Post&gt; Posts { get; set; }
  }
  
  public class Post
  {
      public int PostId { get; set; }
      public string Title { get; set; }
  
      public int BlogId { get; set; }
      public Blog Blog { get; set; }
  }
  </code></pre>
  
  <p>i see DDL in postgresql and it looks fine. 
  The problem is in querying that data. 
  I want to use eager loading, and this query does not produce results with related data:</p>
  
  <pre><code>        this._context.Blogs
              .Include(blog =&gt; blog.Posts)
              .ToList();
  
  
  SELECT blog."BlogId", blog."Url"
    FROM "Blogs" AS blog
    ORDER BY blog."BlogId"
  </code></pre>
  
  <p>EDIT: This query runs first. If there are no records, it stops here, but if there are some records, then it runs this query: </p>
  
  <pre><code>SELECT "blog.Posts"."PostId", "blog.Posts"."BlogId", "blog.Posts"."Title"
    FROM "Posts" AS "blog.Posts"
    INNER JOIN (
        SELECT blog0."BlogId"
        FROM "Blogs" AS blog0
    ) AS t ON "blog.Posts"."BlogId" = t."BlogId"
    ORDER BY t."BlogId"
  </code></pre>
  
  <p>If i do it other way around, i get correct, but it is confusing that i cant get blog with all related posts.</p>
  
  <pre><code>this._context.Posts
              .Include(post =&gt; post.Blog)
              .ToList();
  
    SELECT post."PostId", post."BlogId", post."Title", "post.Blog"."BlogId", "post.Blog"."Url"
    FROM "Posts" AS post
    INNER JOIN "Blogs" AS "post.Blog" ON post."BlogId" = "post.Blog"."BlogId"
  </code></pre>