title: Include collection in Entity Framework Core
body: <p>For example, I have those entities:</p>
  
  <pre><code>public class Book
  {
      [Key]
      public string BookId { get; set; }
      public List&lt;BookPage&gt; Pages { get; set; }
      public string Text { get; set; }
  } 
  
  public class BookPage
  {
      [Key]
      public string BookPageId { get; set; }
      public PageTitle PageTitle { get; set; }
      public int Number { get; set; }
  }
  
  public class PageTitle
  {
      [Key]
      public string PageTitleId { get; set; }
      public string Title { get; set; }
  }
  </code></pre>
  
  <p>How should I load all PageTitles, if I know only the BookId?</p>
  
  <p>Here it is how I'm trying to do this:</p>
  
  <pre><code>using (var dbContext = new BookContext())
  {
      var bookPages = dbContext
          .Book
          .Include(x =&gt; x.Pages)
          .ThenInclude(x =&gt; x.Select(y =&gt; y.PageTitle))
          .SingleOrDefault(x =&gt; x.BookId == "some example id")
          .Pages
          .Select(x =&gt; x.PageTitle)
          .ToList();
  }
  </code></pre>
  
  <p>But the problem is, that it throws exception</p>
  
  <blockquote>
    <p>ArgumentException: The properties expression 'x => {from Pages y
    in x select [y].PageTitle}' is not valid. The expression should represent
    a property access: 't => t.MyProperty'. When specifying multiple
    properties use an anonymous type: 't => new { t.MyProperty1,
    t.MyProperty2 }'. Parameter name: propertyAccessExpression</p>
  </blockquote>
  
  <p>What's wrong, what exactly should I do?</p>