Пример #1
0
        public IQueryable <TSource> Sort <TSource>(
            IQueryable <TSource> source)
        {
            if (!Instance.Any())
            {
                return(source);
            }

            IOrderedQueryable <TSource> sortedSource
                = source.AddInitialSortOperation(
                      Instance.Dequeue(), _parameter);

            while (Instance.Any())
            {
                sortedSource
                    = sortedSource.AddSortOperation(
                          Instance.Dequeue(), _parameter);
            }

            return(sortedSource);
        }
Пример #2
0
        public IQueryable <TSource> Sort <TSource>(
            IQueryable <TSource> source)
        {
            if (!SortOperations.Any())
            {
                return(source);
            }

            IOrderedQueryable <TSource> sortedSource
                = source.AddInitialSortOperation(
                      SortOperations.Dequeue());

            while (SortOperations.Any())
            {
                sortedSource
                    = sortedSource.AddSortOperation(
                          SortOperations.Dequeue());
            }

            return(sortedSource);
        }