示例#1
0
        void SetBinary(BinaryExpression expression)
        {
            var left = Expression.Lambda(expression.Left).Compile().DynamicInvoke();

            if (!(left is Selector) && expression.Left.NodeType != ExpressionType.Convert)
            {
                left = Selector.Value(left);
            }

            var right = Expression.Lambda(expression.Right).Compile().DynamicInvoke();

            if (!(right is Selector) && expression.Right.NodeType != ExpressionType.Convert)
            {
                right = Selector.Value(right);
            }

            Set(left, right, expression.NodeType.ToStringLower());
        }
示例#2
0
        void SetBoolean(Expression expression)
        {
            var value = Selector.Value(Expression.Lambda(expression).Compile().DynamicInvoke());

            Set(value, value, ExpressionType.Equal.ToStringLower());
        }