Пример #1
0
            private SqlExpression CreateComparison(SqlExpression a, SqlExpression b, Expression source)
            {
                SqlExpression lower = sql.Binary(SqlNodeType.LT, a, b);
                SqlExpression equal = sql.Binary(SqlNodeType.EQ2V, a, b);

                return(sql.SearchedCase(
                           new SqlWhen[] {
                    new SqlWhen(lower, sql.ValueFromObject(-1, false, source)),
                    new SqlWhen(equal, sql.ValueFromObject(0, false, source)),
                },
                           sql.ValueFromObject(1, false, source), source
                           ));
            }