@@ -125,6 +125,7 @@ public static bool All(this IQueryable source, ParsingConfig config, string pred
125125 Check . NotNull ( source ) ;
126126 Check . NotNull ( config ) ;
127127 Check . NotEmpty ( predicate ) ;
128+ Check . Args ( args ) ;
128129
129130 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
130131 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -176,6 +177,7 @@ public static bool Any(this IQueryable source, ParsingConfig config, string pred
176177 Check . NotNull ( source ) ;
177178 Check . NotNull ( config ) ;
178179 Check . NotEmpty ( predicate ) ;
180+ Check . Args ( args ) ;
179181
180182 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
181183 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -246,6 +248,7 @@ public static double Average(this IQueryable source, ParsingConfig config, strin
246248 Check . NotNull ( source ) ;
247249 Check . NotNull ( config ) ;
248250 Check . NotEmpty ( predicate ) ;
251+ Check . Args ( args ) ;
249252
250253 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
251254 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -399,6 +402,7 @@ public static int Count(this IQueryable source, ParsingConfig config, string pre
399402 Check . NotNull ( source ) ;
400403 Check . NotNull ( config ) ;
401404 Check . NotEmpty ( predicate ) ;
405+ Check . Args ( args ) ;
402406
403407 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
404408 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -529,6 +533,7 @@ public static dynamic First(this IQueryable source, ParsingConfig config, string
529533 Check . NotNull ( source ) ;
530534 Check . NotNull ( config ) ;
531535 Check . NotEmpty ( predicate ) ;
536+ Check . Args ( args ) ;
532537
533538 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
534539 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -601,6 +606,7 @@ public static dynamic FirstOrDefault(this IQueryable source, ParsingConfig confi
601606 Check . NotNull ( source ) ;
602607 Check . NotNull ( config ) ;
603608 Check . NotEmpty ( predicate ) ;
609+ Check . Args ( args ) ;
604610
605611 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
606612 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -679,8 +685,9 @@ internal static IQueryable InternalGroupBy(IQueryable source, ParsingConfig conf
679685 {
680686 Check . NotNull ( source ) ;
681687 Check . NotNull ( config ) ;
682- Check . NotEmpty ( keySelector , nameof ( keySelector ) ) ;
683- Check . NotEmpty ( resultSelector , nameof ( resultSelector ) ) ;
688+ Check . NotEmpty ( keySelector ) ;
689+ Check . NotEmpty ( resultSelector ) ;
690+ Check . Args ( args ) ;
684691
685692 bool createParameterCtor = config . EvaluateGroupByAtDatabase || SupportsLinqToObjects ( config , source ) ;
686693 LambdaExpression keyLambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , keySelector , args ) ;
@@ -807,7 +814,8 @@ internal static IQueryable InternalGroupBy(IQueryable source, ParsingConfig conf
807814 {
808815 Check . NotNull ( source ) ;
809816 Check . NotNull ( config ) ;
810- Check . NotEmpty ( keySelector , nameof ( keySelector ) ) ;
817+ Check . NotEmpty ( keySelector ) ;
818+ Check . Args ( args ) ;
811819
812820 bool createParameterCtor = config . EvaluateGroupByAtDatabase || SupportsLinqToObjects ( config , source ) ;
813821 LambdaExpression keyLambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , keySelector , args ) ;
@@ -932,12 +940,13 @@ private static IEnumerable<GroupResult> GroupByManyInternal<TElement>(IEnumerabl
932940 /// <returns>An <see cref="IQueryable"/> obtained by performing a grouped join on two sequences.</returns>
933941 public static IQueryable GroupJoin ( this IQueryable outer , ParsingConfig config , IEnumerable inner , string outerKeySelector , string innerKeySelector , string resultSelector , params object ? [ ] args )
934942 {
935- Check . NotNull ( outer , nameof ( outer ) ) ;
943+ Check . NotNull ( outer ) ;
936944 Check . NotNull ( config ) ;
937- Check . NotNull ( inner , nameof ( inner ) ) ;
938- Check . NotEmpty ( outerKeySelector , nameof ( outerKeySelector ) ) ;
939- Check . NotEmpty ( innerKeySelector , nameof ( innerKeySelector ) ) ;
940- Check . NotEmpty ( resultSelector , nameof ( resultSelector ) ) ;
945+ Check . NotNull ( inner ) ;
946+ Check . NotEmpty ( outerKeySelector ) ;
947+ Check . NotEmpty ( innerKeySelector ) ;
948+ Check . NotEmpty ( resultSelector ) ;
949+ Check . Args ( args ) ;
941950
942951 Type outerType = outer . ElementType ;
943952 Type innerType = inner . AsQueryable ( ) . ElementType ;
@@ -989,12 +998,13 @@ public static IQueryable Join(this IQueryable outer, ParsingConfig config, IEnum
989998 {
990999 //http://stackoverflow.com/questions/389094/how-to-create-a-dynamic-linq-join-extension-method
9911000
992- Check . NotNull ( outer , nameof ( outer ) ) ;
1001+ Check . NotNull ( outer ) ;
9931002 Check . NotNull ( config ) ;
994- Check . NotNull ( inner , nameof ( inner ) ) ;
995- Check . NotEmpty ( outerKeySelector , nameof ( outerKeySelector ) ) ;
996- Check . NotEmpty ( innerKeySelector , nameof ( innerKeySelector ) ) ;
997- Check . NotEmpty ( resultSelector , nameof ( resultSelector ) ) ;
1003+ Check . NotNull ( inner ) ;
1004+ Check . NotEmpty ( outerKeySelector ) ;
1005+ Check . NotEmpty ( innerKeySelector ) ;
1006+ Check . NotEmpty ( resultSelector ) ;
1007+ Check . Args ( args ) ;
9981008
9991009 Type outerType = outer . ElementType ;
10001010 Type innerType = inner . AsQueryable ( ) . ElementType ;
@@ -1094,6 +1104,7 @@ public static dynamic Last(this IQueryable source, ParsingConfig config, string
10941104 Check . NotNull ( source ) ;
10951105 Check . NotNull ( config ) ;
10961106 Check . NotEmpty ( predicate ) ;
1107+ Check . Args ( args ) ;
10971108
10981109 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
10991110 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -1166,6 +1177,7 @@ public static dynamic LastOrDefault(this IQueryable source, ParsingConfig config
11661177 Check . NotNull ( source ) ;
11671178 Check . NotNull ( config ) ;
11681179 Check . NotEmpty ( predicate ) ;
1180+ Check . Args ( args ) ;
11691181
11701182 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
11711183 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -1244,6 +1256,7 @@ public static long LongCount(this IQueryable source, ParsingConfig config, strin
12441256 Check . NotNull ( source ) ;
12451257 Check . NotNull ( config ) ;
12461258 Check . NotEmpty ( predicate ) ;
1259+ Check . Args ( args ) ;
12471260
12481261 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
12491262 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -1316,6 +1329,7 @@ public static object Max(this IQueryable source, ParsingConfig config, string pr
13161329 Check . NotNull ( source ) ;
13171330 Check . NotNull ( config ) ;
13181331 Check . NotEmpty ( predicate ) ;
1332+ Check . Args ( args ) ;
13191333
13201334 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
13211335 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , typeof ( object ) , predicate , args ) ;
@@ -1388,6 +1402,7 @@ public static object Min(this IQueryable source, ParsingConfig config, string pr
13881402 Check . NotNull ( source ) ;
13891403 Check . NotNull ( config ) ;
13901404 Check . NotEmpty ( predicate ) ;
1405+ Check . Args ( args ) ;
13911406
13921407 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
13931408 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , typeof ( object ) , predicate , args ) ;
@@ -1545,6 +1560,8 @@ public static IOrderedQueryable<TSource> OrderBy<TSource>(this IQueryable<TSourc
15451560 /// </example>
15461561 public static IOrderedQueryable OrderBy ( this IQueryable source , ParsingConfig config , string ordering , params object ? [ ] args )
15471562 {
1563+ Check . Args ( args ) ;
1564+
15481565 if ( args . Length > 0 && args [ 0 ] != null && args [ 0 ] ! . GetType ( ) . GetInterfaces ( ) . Any ( i => i . Name . Contains ( "IComparer`1" ) ) )
15491566 {
15501567 return InternalOrderBy ( source , config , ordering , args [ 0 ] ! , args ) ;
@@ -1584,6 +1601,7 @@ internal static IOrderedQueryable InternalOrderBy(IQueryable source, ParsingConf
15841601 Check . NotNull ( source ) ;
15851602 Check . NotNull ( config ) ;
15861603 Check . NotEmpty ( ordering ) ;
1604+ Check . Args ( args ) ;
15871605
15881606 ParameterExpression [ ] parameters = [ ParameterExpressionHelper . CreateParameterExpression ( source . ElementType , string . Empty , config . RenameEmptyParameterExpressionNames ) ] ;
15891607 var parser = new ExpressionParser ( parameters , ordering , args , config , true ) ;
@@ -1758,6 +1776,7 @@ public static IQueryable Select(this IQueryable source, ParsingConfig config, st
17581776 Check . NotNull ( source ) ;
17591777 Check . NotNull ( config ) ;
17601778 Check . NotEmpty ( selector ) ;
1779+ Check . Args ( args ) ;
17611780
17621781 bool createParameterCtor = config . EvaluateGroupByAtDatabase || SupportsLinqToObjects ( config , source ) ;
17631782 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , selector , args ) ;
@@ -1799,6 +1818,7 @@ public static IQueryable<TResult> Select<TResult>(this IQueryable source, Parsin
17991818 Check . NotNull ( source ) ;
18001819 Check . NotNull ( config ) ;
18011820 Check . NotEmpty ( selector ) ;
1821+ Check . Args ( args ) ;
18021822
18031823 bool createParameterCtor = config . EvaluateGroupByAtDatabase || SupportsLinqToObjects ( config , source ) ;
18041824 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , typeof ( TResult ) , selector , args ) ;
@@ -1841,8 +1861,9 @@ public static IQueryable Select(this IQueryable source, ParsingConfig config, Ty
18411861 {
18421862 Check . NotNull ( source ) ;
18431863 Check . NotNull ( config ) ;
1844- Check . NotNull ( resultType , nameof ( resultType ) ) ;
1864+ Check . NotNull ( resultType ) ;
18451865 Check . NotEmpty ( selector ) ;
1866+ Check . Args ( args ) ;
18461867
18471868 bool createParameterCtor = config . EvaluateGroupByAtDatabase || SupportsLinqToObjects ( config , source ) ;
18481869 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , resultType , selector , args ) ;
@@ -1907,6 +1928,7 @@ public static IQueryable SelectMany(this IQueryable source, ParsingConfig config
19071928 Check . NotNull ( config ) ;
19081929 Check . NotNull ( resultType ) ;
19091930 Check . NotEmpty ( selector ) ;
1931+ Check . Args ( args ) ;
19101932
19111933 return SelectManyInternal ( source , config , resultType , selector , args ) ;
19121934 }
@@ -1978,6 +2000,7 @@ public static IQueryable<TResult> SelectMany<TResult>(this IQueryable source, Pa
19782000 Check . NotNull ( source ) ;
19792001 Check . NotNull ( config ) ;
19802002 Check . NotEmpty ( selector ) ;
2003+ Check . Args ( args ) ;
19812004
19822005 bool createParameterCtor = config . EvaluateGroupByAtDatabase || SupportsLinqToObjects ( config , source ) ;
19832006 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , selector , args ) ;
@@ -2076,10 +2099,12 @@ public static IQueryable SelectMany(
20762099 {
20772100 Check . NotNull ( source ) ;
20782101 Check . NotNull ( config ) ;
2079- Check . NotEmpty ( collectionSelector , nameof ( collectionSelector ) ) ;
2080- Check . NotEmpty ( collectionParameterName , nameof ( collectionParameterName ) ) ;
2081- Check . NotEmpty ( resultSelector , nameof ( resultSelector ) ) ;
2082- Check . NotEmpty ( resultParameterName , nameof ( resultParameterName ) ) ;
2102+ Check . NotEmpty ( collectionSelector ) ;
2103+ Check . NotEmpty ( collectionParameterName ) ;
2104+ Check . NotEmpty ( resultSelector ) ;
2105+ Check . NotEmpty ( resultParameterName ) ;
2106+ Check . Args ( collectionSelectorArgs ) ;
2107+ Check . Args ( resultSelectorArgs ) ;
20832108
20842109 bool createParameterCtor = config . EvaluateGroupByAtDatabase || SupportsLinqToObjects ( config , source ) ;
20852110 LambdaExpression sourceSelectLambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , collectionSelector , collectionSelectorArgs ) ;
@@ -2227,6 +2252,7 @@ public static dynamic SingleOrDefault(this IQueryable source, ParsingConfig conf
22272252 Check . NotNull ( source ) ;
22282253 Check . NotNull ( config ) ;
22292254 Check . NotEmpty ( predicate ) ;
2255+ Check . Args ( args ) ;
22302256
22312257 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
22322258 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -2309,6 +2335,7 @@ public static IQueryable SkipWhile(this IQueryable source, ParsingConfig config,
23092335 Check . NotNull ( source ) ;
23102336 Check . NotNull ( config ) ;
23112337 Check . NotNull ( predicate ) ;
2338+ Check . Args ( args ) ;
23122339
23132340 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
23142341 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -2365,6 +2392,7 @@ public static object Sum(this IQueryable source, ParsingConfig config, string pr
23652392 Check . NotNull ( source ) ;
23662393 Check . NotNull ( config ) ;
23672394 Check . NotEmpty ( predicate ) ;
2395+ Check . Args ( args ) ;
23682396
23692397 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
23702398 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -2439,6 +2467,7 @@ public static IQueryable TakeWhile(this IQueryable source, ParsingConfig config,
24392467 Check . NotNull ( source ) ;
24402468 Check . NotNull ( config ) ;
24412469 Check . NotNull ( predicate ) ;
2470+ Check . Args ( args ) ;
24422471
24432472 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
24442473 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
@@ -2553,6 +2582,7 @@ internal static IOrderedQueryable InternalThenBy(IOrderedQueryable source, Parsi
25532582 Check . NotNull ( source ) ;
25542583 Check . NotNull ( config ) ;
25552584 Check . NotEmpty ( ordering ) ;
2585+ Check . Args ( args ) ;
25562586
25572587 ParameterExpression [ ] parameters = { ParameterExpressionHelper . CreateParameterExpression ( source . ElementType , string . Empty , config . RenameEmptyParameterExpressionNames ) } ;
25582588 ExpressionParser parser = new ExpressionParser ( parameters , ordering , args , config ) ;
@@ -2649,6 +2679,7 @@ public static IQueryable Where(this IQueryable source, ParsingConfig config, str
26492679 Check . NotNull ( source ) ;
26502680 Check . NotNull ( config ) ;
26512681 Check . NotEmpty ( predicate ) ;
2682+ Check . Args ( args ) ;
26522683
26532684 bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
26542685 LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
0 commit comments