예제 #1
0
        /// <summary>
        /// 创建一个排序表达式实例
        /// </summary>
        /// <param name="fieldName"></param>
        /// <param name="direction"></param>
        /// <returns></returns>
        public static OrderExpression CreateInstance(string fieldName, string direction)
        {
            OrderExpression order = null;

            switch (direction)
            {
            case "降序":
            case "降":
            case "DESC":
            case "Desc":
            case "desc":
            case "D":
            case "d":
                order = OrderExpression.Desc(fieldName);
                break;

            default:
                order = OrderExpression.Asc(fieldName);
                break;
            }

            return(order);
        }
예제 #2
0
 /// <summary>
 /// 添加排序表达式
 /// </summary>
 /// <param name="exp"></param>
 /// <returns></returns>
 public QueryParameter AddOrderExpr(OrderExpression exp)
 {
     this._orderExpressions.Add(exp);
     return(this);
 }