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); }
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; }
public static HqlBooleanExpression ToBooleanExpression(this HqlTreeNode node) { var hqlDot = node as HqlDot; if (hqlDot != null) { return(new HqlBooleanDot(hqlDot.Factory, hqlDot)); } var hqlBooleanExpression = node as HqlBooleanExpression; if (hqlBooleanExpression != null) { return(hqlBooleanExpression); } var builder = new HqlTreeBuilder(); return(builder.Equality(node.AsExpression(), builder.True())); }