/// <summary> /// 解析 orderby 语句 /// </summary> /// <param name="orderByClause"></param> /// <param name="queryModel"></param> /// <param name="index"></param> public override void VisitOrderByClause( OrderByClause orderByClause, QueryModel queryModel, int index ) { foreach( var ordering in orderByClause.Orderings ) { OracleOrderByClauseVisitor visitor = new OracleOrderByClauseVisitor( this.parameters ); string orderByParts = visitor.Translate( ordering.Expression ); string direction = ordering.OrderingDirection == OrderingDirection.Desc ? "DESC" : "ASC"; queryPartsAggregator.OrderByParts.Add( string.Format( "{0} {1}", orderByParts, direction ) ); } base.VisitOrderByClause( orderByClause, queryModel, index ); }
/// <summary> /// 解析 orderby 语句 /// </summary> /// <param name="orderByClause"></param> /// <param name="queryModel"></param> /// <param name="index"></param> public override void VisitOrderByClause( OrderByClause orderByClause, QueryModel queryModel, int index ) { foreach( var ordering in orderByClause.Orderings ) { OracleOrderByPartsCommandBuilder orderBuilder = new OracleOrderByPartsCommandBuilder(); OracleOrderByClauseVisitor visitor = new OracleOrderByClauseVisitor(); visitor.Translate( ordering.Expression, orderBuilder ); string direction = ordering.OrderingDirection == OrderingDirection.Desc ? "desc" : "asc"; commandBuilder.OrderByParts.Add( string.Format( "{0} {1}", orderBuilder.ToString(), direction ) ); } base.VisitOrderByClause( orderByClause, queryModel, index ); }