public void ThenBy_Dynamic_Exceptions() { //Arrange var testList = User.GenerateSampleModels(100, allowNullableProfiles: true); var qry = testList.AsQueryable(); //Act var ordered = qry.OrderBy("Id"); Assert.Throws <ParseException>(() => ordered.ThenBy("Bad=3")); Assert.Throws <ParseException>(() => ordered.Where("Id=123")); Assert.Throws <ArgumentNullException>(() => DynamicQueryableExtensions.ThenBy(null, "Id")); Assert.Throws <ArgumentNullException>(() => ordered.ThenBy(null)); Assert.Throws <ArgumentException>(() => ordered.ThenBy("")); Assert.Throws <ArgumentException>(() => ordered.ThenBy(" ")); }
public static IOrderedQueryable <TSource> ThenByInterpolated <TSource>(this IOrderedQueryable <TSource> source, FormattableString ordering) { var orderingStr = ParseFormattableString(ordering, out var args); return(DynamicQueryableExtensions.ThenBy(source, orderingStr, args)); }
public static IOrderedQueryable ThenByInterpolated(this IOrderedQueryable source, FormattableString ordering, IComparer comparer) { var orderingStr = ParseFormattableString(ordering, out var args); return(DynamicQueryableExtensions.ThenBy(source, orderingStr, comparer, args)); }