title: Entity Framework include children that grand children are null
body: <p>Seem like a simple one, but not coming up with the right thing.  All that I need to do is get a count of child items that have it's own child null.  Here is what I have been working with:</p>
  
  <pre><code>var data = await _context.award.Include(a =&gt; a.expenses.Select(p =&gt; p.invoice == null)).ToListAsync();
  </code></pre>
  
  <p>I have also tried other combinations here with no luck. The error I get is </p>
  
  <blockquote>
    <p>InvalidOperationException: The property expression 'a => {from expense p in [a].expenses select ([p].invoice == null)}' is not valid. The expression should represent a property access: 't => t.MyProperty'.</p>
  </blockquote>
  
  <p>I change it to match and it just triggers a new error.  </p>
  
  <p>I just want to get a list of <code>award</code> with it's list of <code>expenses</code> listed (fine with just the <code>.ID</code> if that influences the solution) where the <code>invoice</code> parent object is not set and is <code>null</code>.  </p>
  
  <p><strong>UPDATE</strong>
  requested models</p>
  
  <pre><code>public class invoice
  {
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int ID { get; set; }
  
      [ForeignKey("INV_NUM_ForeignKey")]
      public invoice_number fin_invoice_number { get; set; }
  }
  
  public class invoice_number
  {
      [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
      public int ID { get; set; }
  
      public int number { get; set; }
  
      public invoice invoice { get; set; }
  
      public string display { get { return string.Format("sps-{0}", (new String('0', 6) + number.ToString())).Substring(number.ToString().Count()-7, number.ToString().Count()); } }
  }
  </code></pre>