Ejemplo n.º 1
0
        private static Expression ConvertToBoolean(Expression expression)
        {
            var converted = new BooleanConvertingVisitor().AttemptToConvert(expression);
            if (converted.Type != typeof(bool))
                throw new InvalidOperationException("Could not convert type of " + expression + " to System.Boolean.");

            return converted;
        }
Ejemplo n.º 2
0
        private static Expression ConvertToBoolean(Expression expression)
        {
            var converted = new BooleanConvertingVisitor().AttemptToConvert(expression);

            if (converted.Type != typeof(bool))
            {
                throw new InvalidOperationException("Could not convert type of " + expression + " to System.Boolean.");
            }

            return(converted);
        }