public void InvokeSort_IQueryableAscending_ShouldReturnOrderedList()
        {
            var result = _orderValue1Asc.InvokeSort(_fixture.Query).ToList();

            result[0].Value1.ShouldBe(1);
            result[1].Value1.ShouldBe(2);
            result[2].Value1.ShouldBe(3);
        }
예제 #2
0
        public static IOrderedQueryable <TEntity> OrderBy <TEntity>(this IQueryable <TEntity> query, IOrderSpecification <TEntity> orderSpecification)
            where TEntity : class
        {
            if (orderSpecification == null)
            {
                throw new ArgumentNullException(nameof(orderSpecification));
            }

            return(orderSpecification.InvokeSort(query));
        }
예제 #3
0
        public static IOrderedEnumerable <TEntity> ThenBy <TEntity>(this IOrderedEnumerable <TEntity> collection, IOrderSpecification <TEntity> orderSpecification)
            where TEntity : class
        {
            if (orderSpecification == null)
            {
                throw new ArgumentNullException(nameof(orderSpecification));
            }

            return(orderSpecification.InvokeSort(collection));
        }
예제 #4
0
 public static IOrderedQueryable <TEntity> OrderBy <TEntity>(this IQueryable <TEntity> query, IOrderSpecification <TEntity> orderSpecification)
     where TEntity : class
 {
     return(orderSpecification.InvokeSort(query));
 }
예제 #5
0
 public static IOrderedEnumerable <TEntity> ThenBy <TEntity>(this IOrderedEnumerable <TEntity> collection, IOrderSpecification <TEntity> orderSpecification)
     where TEntity : class
 {
     return(orderSpecification.InvokeSort(collection));
 }