title: using where clause inside include generate error "The Include path expression must refer to a navigation property defined on the type"
body: <p>I want to filter attachment when get a billing:</p>
  
  <pre><code>var billing = db.Billings
                  .Include(b =&gt; b.Client)
                  .Include(b =&gt; b.Attachments.Where(a =&gt; a.WorkflowStateID == workflowStateID))
                  .Where(b =&gt; b.BillingID == id)
                  .FirstOrDefault();
  </code></pre>
  
  <p>Billing Entity:</p>
  
  <pre><code>public partial class Billing
      {
          public Billing()
          {
              this.Attachments = new HashSet&lt;Attachment&gt;();
          }
  
          public long BillingID { get; set; }
          public int ClientID { get; set; }
  
          public virtual ICollection&lt;Attachment&gt; Attachments { get; set; }
          public virtual Client Client { get; set; }
      }
  </code></pre>
  
  <p>but it gives an error </p>
  
  <pre><code>The Include path expression must refer to a navigation property defined on the type.
  Use dotted paths for reference navigation properties and the Select operator for 
  collection navigation properties
  </code></pre>
  
  <p>How to use <code>where</code> clause on include?
  What I want to achieve is if I translate in query sql:</p>
  
  <pre><code>select * 
  from Billing b
      inner join Client c on b.ClientID = c.ClientID
      inner join (select * from Attachment a where a.WorkflowStateID = @workflowStateID) t on b.BillingID = t.BillingID
  where b.BillingID = @billingID
  </code></pre>