Example #1
0
 public IObQueryable <TModel> OrderBy(IObQueryable <TModel> queryable)
 {
     if (ObSort == null)
     {
         ObSort = new ObSort();
     }
     ObSort.Add(queryable.ObSort);
     return(this);
 }
Example #2
0
        public IObQueryable <TModel> OrderByDescending <TKey>(Expression <Func <TModel, TKey> > keySelector)
        {
            if (ObSort == null)
            {
                ObSort = new ObSort();
            }
            var body  = keySelector.Body;
            var value = CreateValue(body);

            if (value is ObProperty obProperty)
            {
                ObSort.AddOrderBy(obProperty);
            }
            if (value is object[] objs)
            {
                ObSort.AddOrderByDescending(objs.Select(o => (ObProperty)o).ToArray());
            }
            return(this);
        }