Inheritance: SqlExpression
Exemplo n.º 1
0
        public override SqlExpression VisitUnary(SqlUnaryExpression unary)
        {
            var unaryOpString = GetUnaryOperatorString(unary.ExpressionType);

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

            return(unary);
        }
Exemplo n.º 2
0
        public virtual SqlExpression VisitUnary(SqlUnaryExpression expression)
        {
            var operand = expression.Operand;

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

            return(SqlExpression.Unary(expression.ExpressionType, operand));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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;
        }