public static IOrderedQueryable <T> OrderBy <T>(this IQueryable <T> query, IOrderSpecification <T> specification) { if (specification == null) { throw new ArgumentNullException(nameof(specification)); } return(specification.Invoke(query)); }
public static IOrderedEnumerable <T> ThenBy <T>(this IOrderedEnumerable <T> query, IOrderSpecification <T> specification) { return(specification == null ? throw new ArgumentNullException(nameof(specification)) : specification.Invoke(query)); }