示例#1
0
        private void ParseMethodContains(MethodCallExpression node)
        {
            var column        = new FunctionColumn();
            var objectVisitor = new MemberExpressionVisitor(Context);
            var paramVisitor  = new MemberExpressionVisitor(Context);

            if (node.Object != null && (node.Object.NodeType == ExpressionType.MemberAccess || node.Object.NodeType == ExpressionType.Constant))
            {
                objectVisitor.Visit(node.Object);

                paramVisitor.Visit(node.Arguments[0]);
            }
            else
            {
                objectVisitor.Visit(node.Arguments[1]);

                paramVisitor.Visit(node.Arguments[0]);
            }

            if (objectVisitor.Column.Type == typeof(string))
            {
                column.Formatter = "LOCATE({1}, {0}) > 0";
            }
            else
            {
                column.Formatter = "{0} in {1}";
            }
            column.Add(objectVisitor.Column);
            column.Add(paramVisitor.Column);
            this.Column = column;
        }
示例#2
0
        private void ParseMethodMax(MethodCallExpression node)
        {
            var column = new FunctionColumn();

            column.Formatter = "Max({0})";

            var paramVisitor = new MemberExpressionVisitor(Context);

            paramVisitor.Visit(node.Arguments[1]);
            column.Add(paramVisitor.Column);
            this.Column = column;
        }
        private void ParseMethodMax(MethodCallExpression node)
        {
            var column = new FunctionColumn();
            column.Formatter = "Max({0})";

            var paramVisitor = new MemberExpressionVisitor(Context);
            paramVisitor.Visit(node.Arguments[1]);
            column.Add(paramVisitor.Column);
            this.Column = column;
        }
        private void ParseMethodContains(MethodCallExpression node)
        {
            var column = new FunctionColumn();
            var objectVisitor = new MemberExpressionVisitor(Context);
            var paramVisitor = new MemberExpressionVisitor(Context);
            if (node.Object != null && (node.Object.NodeType == ExpressionType.MemberAccess || node.Object.NodeType == ExpressionType.Constant))
            {
                objectVisitor.Visit(node.Object);

                paramVisitor.Visit(node.Arguments[0]);

            }
            else
            {
                objectVisitor.Visit(node.Arguments[1]);

                paramVisitor.Visit(node.Arguments[0]);
            }

            if (objectVisitor.Column.Type == typeof(string))
            {
                column.Formatter = "LOCATE({1}, {0}) > 0";
            }
            else
            {
                column.Formatter = "{0} in {1}";
            }
            column.Add(objectVisitor.Column);
            column.Add(paramVisitor.Column);
            this.Column = column;
        }