예제 #1
0
        /// <summary>
        /// 解析 Where 语句
        /// </summary>
        /// <param name="whereClause"></param>
        /// <param name="queryModel"></param>
        /// <param name="index"></param>
        public override void VisitWhereClause(WhereClause whereClause, QueryModel queryModel, int index)
        {
            SqlServerWhereClauseVisitor visitor = new SqlServerWhereClauseVisitor(this.parameters);

            string whereParts = visitor.Translate(whereClause.Predicate);

            queryPartsAggregator.WhereParts.Add(whereParts);

            base.VisitWhereClause(whereClause, queryModel, index);
        }
예제 #2
0
        /// <summary>
        /// 解析 Where 语句
        /// </summary>
        /// <param name="whereClause"></param>
        /// <param name="queryModel"></param>
        /// <param name="index"></param>
        public override void VisitWhereClause(WhereClause whereClause, QueryModel queryModel, int index)
        {
            SqlServerWherePartsCommandBuilder whereBuilder = new SqlServerWherePartsCommandBuilder(this.commandBuilder.Parameters);

            SqlServerWhereClauseVisitor visitor = new SqlServerWhereClauseVisitor();

            visitor.Translate(whereClause.Predicate, whereBuilder);

            commandBuilder.WhereParts.Add(whereBuilder.ToString());

            base.VisitWhereClause(whereClause, queryModel, index);
        }