title: NHibernate IQueryOver where clause with a collection
body: <p>I'm attemping to do a simple check for an empty collection in an NHIbernate Query. Here's my code:</p>
  
  <pre><code>var query = QueryNotDeleted().Where(x=&gt;x.Markets.Count() &gt; 0);
  </code></pre>
  
  <p>QueryNotDeleted returns an IQueryOver.  The above line throws an error (Unrecognised method call in epression x.Markets.Count()) because it doesn't recognize the Count() in the query.</p>
  
  <p>I tried</p>
  
  <pre><code>var query = QueryNotDeleted().Where(x=&gt;x.Markets != null);
  </code></pre>
  
  <p>But unfortunately, Markets is never NULL, so I have to test for a count instead of it being null to get the records I want.</p>
  
  <p>How can I get this "count" syntax correct so that it excludes records where the Markets property is empty?</p>