Example #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;
        }
Example #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);
        }