Пример #1
0
        public override SqlExpression VisitUnary(SqlUnaryExpression unary)
        {
            var unaryOpString = GetUnaryOperatorString(unary.ExpressionType);

            builder.Append(unaryOpString);
            builder.Append(" ");
            Visit(unary.Operand);

            return(unary);
        }
Пример #2
0
        public virtual SqlExpression VisitUnary(SqlUnaryExpression expression)
        {
            var operand = expression.Operand;

            if (operand != null)
            {
                operand = Visit(operand);
            }

            return(SqlExpression.Unary(expression.ExpressionType, operand));
        }
Пример #3
0
        public override SqlExpression VisitUnary(SqlUnaryExpression unary)
        {
            var operand = Visit(unary.Operand);

            if (operand.ExpressionType != SqlExpressionType.Constant)
            {
                throw new ExpressionEvaluateException("Operand of a unary operator could not be evaluated to a constant.");
            }

            var result = EvaluateUnary(((SqlConstantExpression)operand).Value, unary.ExpressionType);

            return(SqlExpression.Constant(result));
        }
Пример #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="unary"></param>
        /// <returns></returns>
        public virtual SqlExpression VisitUnary(SqlUnaryExpression unary)
        {
            var operand = unary.Operand;
            if (operand != null)
                operand = Visit(operand);

            return SqlExpression.Unary(unary.ExpressionType, operand);
        }
        public override SqlExpression VisitUnary(SqlUnaryExpression unary)
        {
            var operand = Visit(unary.Operand);
            if (operand.ExpressionType != SqlExpressionType.Constant)
                throw new ExpressionEvaluateException("Operand of a unary operator could not be evaluated to a constant.");

            var result = EvaluateUnary(((SqlConstantExpression)operand).Value, unary.ExpressionType);
            return SqlExpression.Constant(result);
        }
        public override SqlExpression VisitUnary(SqlUnaryExpression unary)
        {
            var unaryOpString = GetUnaryOperatorString(unary.ExpressionType);
            builder.Append(unaryOpString);
            builder.Append(" ");
            Visit(unary.Operand);

            return unary;
        }