/// <summary>
        /// 指定属性名,按升序对序列中的元素执行后续排序。
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="query"></param>
        /// <param name="ordering"><see cref="Ordering"/></param>
        /// <returns></returns>
        public static IOrderedQueryable <T> ThenBy <T>(this IOrderedQueryable <T> query, Ordering ordering)
        {
            if (ordering == null)
            {
                throw new ArgumentNullException(nameof(ordering));
            }
            string methodName = ordering.Dir == Direction.Asc ? "ThenBy" : "ThenByDescending";

            return(CallOrderedQueryable(query, methodName, ordering.Name, null));
        }
Exemple #2
0
 /// <summary>
 /// 克隆构造函数
 /// </summary>
 /// <param name="ordering"></param>
 public Ordering(Ordering ordering)
 {
     Name = ordering.Name;
     Dir  = ordering.Dir;
 }