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); }
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)); }
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)); }
public static IOrderedQueryable <TEntity> OrderBy <TEntity>(this IQueryable <TEntity> query, IOrderSpecification <TEntity> orderSpecification) where TEntity : class { return(orderSpecification.InvokeSort(query)); }
public static IOrderedEnumerable <TEntity> ThenBy <TEntity>(this IOrderedEnumerable <TEntity> collection, IOrderSpecification <TEntity> orderSpecification) where TEntity : class { return(orderSpecification.InvokeSort(collection)); }