Conditional Projection with NHibernate
<p>I'm not able to get the following query to work. The grouping and total sum works without problem, but when I try to do the conditional sum, I receive the following error on the compiler:</p>

<pre><code>Error   CS1503  Argument 1: cannot convert from 'NHibernate.Criterion.IProjection' to 'System.Linq.Expressions.Expression&lt;System.Func&lt;ManagementWebBase.Models.FinancialTransaction.FinancialTransactionTO, object&gt;&gt;'
</code></pre>

<p>The code of the function is:</p>

<pre><code>var summary = session.QueryOver&lt;FinancialTransactionTO&gt;().Select(
            Projections.Group&lt;FinancialTransactionTO&gt;(t=&gt;t.Company.Id),
            Projections.Sum&lt;FinancialTransactionTO&gt;(t=&gt;t.Total),
            Projections.Sum&lt;FinancialTransactionTO&gt;(
            Projections.Conditional(
            Restrictions.Where&lt;FinancialTransactionTO&gt;(f =&gt; f.Type.Id == 1),
            Projections.Constant(1),
            Projections.Constant(0)))).List&lt;object&gt;();

        return summary;
</code></pre>

<p>All the examples i've seen have no differences. What am I doing wrong?</p>