public static HqlExpression ConvertBooleanToCase(HqlExpression node) { if (node is HqlBooleanExpression) { var builder = new HqlTreeBuilder(); return builder.Case( new[] {builder.When(node, builder.True())}, builder.False()); } return node; }
internal static HqlExpression ToArithmeticExpression(this HqlTreeNode node) { var hqlBooleanExpression = node as HqlBooleanExpression; if (hqlBooleanExpression != null) { var builder = new HqlTreeBuilder(); return(builder.Case(new[] { builder.When(hqlBooleanExpression, builder.True()) }, builder.False())); } return((HqlExpression)node); }