title: Using Linq (nHibernate) to perform a Case statement with Counts
body: <p>I'm sure this is one has done the houses a few times but i've never found a solution...</p>
  
  <p>So is it possible to do something like this using nHibernate 3 with preferably Linq:</p>
  
  <pre><code>SELECT   
  COUNT(CASE WHEN IsWithdrawn = 1 THEN 1 END) AS WithdrawnCount, 
  COUNT(CASE WHEN IsWithdrawn = 0 THEN 1 END) AS ViewAllCount
  FROM Tutorials
  </code></pre>
  
  <p>I'm pretty sure that is isn't possible and that the best solution is to opt just for sql in this case... but maybe there is something new in nHibernate 3.1 that can do this with, even using queryover?</p>
  
  <p>thanks</p>