Exemplo n.º 1
0
        protected Expression VisitSelectMethodCall(MethodCallExpression m)
        {
            if (m.Arguments[0].NodeType == ExpressionType.Call)
            {
                this.Visit(m.Arguments[0]);
            }
            this.m_processingState = ProcessingState.Select;
            LambdaExpression lambdaExpression = (LambdaExpression)ExpressionUtility.StripQuotes(m.Arguments[1]);

            this.Visit(lambdaExpression.Body);
            return(m);
        }
Exemplo n.º 2
0
        private Expression VisitWhere(MethodCallExpression m)
        {
            this.m_processingState = ProcessingState.Where;
            if (m.Arguments[0].NodeType == ExpressionType.Call)
            {
                this.Visit(m.Arguments[0]);
            }
            this.SqlQuery.AppendFormat(" {0} ", ExpressionUtility.GetSqlQueryExpressionOperator(ExpressionType.AndAlso));
            LambdaExpression lambdaExpression = (LambdaExpression)ExpressionUtility.StripQuotes(m.Arguments[1]);

            this.Visit(lambdaExpression.Body);
            return(m);
        }
Exemplo n.º 3
0
        private Expression VisitWhere(MethodCallExpression m)
        {
            this.m_hasVisitiedBinary = false;
            this.m_processingState   = ProcessingState.Where;
            if (m.Arguments[0].NodeType == ExpressionType.Call)
            {
                this.RecordCallerAndVisit(m.Arguments[0], m);
            }
            this.WhereClause.AppendFormat(" {0} ", this.GetSqlQueryExpressionOperator(ExpressionType.AndAlso));
            this.PartialClause.Clear();
            LambdaExpression lambdaExpression = (LambdaExpression)ExpressionUtility.StripQuotes(m.Arguments[1]);

            this.RecordCallerAndVisit(lambdaExpression.Body, lambdaExpression);
            this.WhereClause.Append(this.PartialClause.ToString());
            return(m);
        }
Exemplo n.º 4
0
        private Expression VisitOrderBy(MethodCallExpression m)
        {
            this.m_HasOrderBy = true;
            this.RecordCallerAndVisit(m.Arguments[0], m);
            if (!string.Equals(m.Method.Name, "OrderBy"))
            {
                this.OrderByClause.Append(", ");
            }
            else
            {
                this.m_processingState = ProcessingState.OrderBy;
            }
            this.PartialClause.Clear();
            LambdaExpression lambdaExpression = (LambdaExpression)ExpressionUtility.StripQuotes(m.Arguments[1]);

            this.RecordCallerAndVisit(lambdaExpression.Body, lambdaExpression);
            this.OrderByClause.Append(this.PartialClause.ToString());
            return(m);
        }
Exemplo n.º 5
0
        private Expression VisitOrderBy(MethodCallExpression m)
        {
            this.m_IsOrderByQuery = true;
            this.Visit(m.Arguments[0]);
            if (!string.Equals(m.Method.Name, "OrderBy"))
            {
                this.SqlQuery.Append(", ");
            }
            else
            {
                this.m_processingState = ProcessingState.OrderBy;
                this.SqlQuery.AppendLine();
                this.SqlQuery.Append("ORDER BY ");
            }
            LambdaExpression lambdaExpression = (LambdaExpression)ExpressionUtility.StripQuotes(m.Arguments[1]);

            this.Visit(lambdaExpression.Body);
            return(m);
        }