예제 #1
0
        public Expression BoolUnaryExpression(BoolUnaryExpression expression)
        {
            if (expression.Operator != Operator.Not)
            {
                throw new NotSupportedException();
            }

            return(expression.Expression);
        }
        public override ICriterion BoolUnaryExpression(BoolUnaryExpression expression)
        {
            var criterion = CreateCriterion(expression.Expression);

            switch (expression.Operator)
            {
            case Operator.Not: return(Restrictions.Not(criterion));

            default: throw new NotSupportedException();
            }
        }
예제 #3
0
        private Expression ResolveBoolUnaryLiteral(BoolUnaryExpression expression, LiteralExpression literal)
        {
            if (expression.Operator != Operator.Not)
            {
                throw new NotSupportedException();
            }

            // CoerceBoolExpression takes care of the type of the literal.

            Debug.Assert(literal.LiteralType == LiteralType.Boolean);

            return(new LiteralExpression(!(bool)literal.Value, LiteralType.Boolean));
        }
예제 #4
0
        public Expression BoolUnaryExpression(BoolUnaryExpression expression)
        {
            var result = expression.Expression.Visit(this);

            var literal = result as LiteralExpression;

            if (literal != null)
            {
                return(ResolveBoolUnaryLiteral(expression, literal));
            }

            return(new BoolUnaryExpression(expression.Operator, result));
        }
예제 #5
0
 public virtual T BoolUnaryExpression(BoolUnaryExpression expression)
 {
     throw new QueryNotSupportException();
 }