Exemplo n.º 1
0
        /// <summary>
        /// Sorts the elements of a sequence in ascending order according to a key.
        /// </summary>
        public IOrderedQuery OrderBy(SortExpression sortExpression)
        {
            if (sortExpression.CheckNotNull(nameof(sortExpression)).SortDirection != SortDirection.Ascending)
            {
                throw new ArgumentException("Expected sort expresson to be ascending.");
            }

            var query = new Query(Type, FilterExpressions, new[] { sortExpression }, SkipValue, TakeValue);

            return(query);
        }