@@ -127,7 +127,7 @@ public static bool All(this IQueryable source, ParsingConfig config, string pred
127
127
Check . NotEmpty ( predicate ) ;
128
128
129
129
bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
130
- LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( createParameterCtor , source . ElementType , null , predicate , args ) ;
130
+ LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
131
131
132
132
return Execute < bool > ( _AllPredicate , source , Expression . Quote ( lambda ) ) ;
133
133
}
@@ -1430,7 +1430,7 @@ public static IQueryable OfType(this IQueryable source, Type type)
1430
1430
Check . NotNull ( source ) ;
1431
1431
Check . NotNull ( type ) ;
1432
1432
1433
- var optimized = OptimizeExpression ( Expression . Call ( null , _ofType . MakeGenericMethod ( type ) , new [ ] { source . Expression } ) ) ;
1433
+ var optimized = OptimizeExpression ( Expression . Call ( null , _ofType . MakeGenericMethod ( type ) , [ source . Expression ] ) ) ;
1434
1434
1435
1435
return source . Provider . CreateQuery ( optimized ) ;
1436
1436
}
@@ -1547,7 +1547,7 @@ public static IOrderedQueryable OrderBy(this IQueryable source, ParsingConfig co
1547
1547
{
1548
1548
if ( args . Length > 0 && args [ 0 ] != null && args [ 0 ] ! . GetType ( ) . GetInterfaces ( ) . Any ( i => i . Name . Contains ( "IComparer`1" ) ) )
1549
1549
{
1550
- return InternalOrderBy ( source , ParsingConfig . Default , ordering , args [ 0 ] ! , args ) ;
1550
+ return InternalOrderBy ( source , config , ordering , args [ 0 ] ! , args ) ;
1551
1551
}
1552
1552
1553
1553
return InternalOrderBy ( source , config , ordering , null , args ) ;
@@ -1806,7 +1806,7 @@ public static IQueryable<TResult> Select<TResult>(this IQueryable source, Parsin
1806
1806
var methodCallExpression = Expression . Call (
1807
1807
typeof ( Queryable ) ,
1808
1808
nameof ( Queryable . Select ) ,
1809
- new [ ] { source . ElementType , typeof ( TResult ) } ,
1809
+ [ source . ElementType , typeof ( TResult ) ] ,
1810
1810
source . Expression ,
1811
1811
Expression . Quote ( lambda )
1812
1812
) ;
@@ -1849,7 +1849,7 @@ public static IQueryable Select(this IQueryable source, ParsingConfig config, Ty
1849
1849
1850
1850
var optimized = OptimizeExpression ( Expression . Call (
1851
1851
typeof ( Queryable ) , nameof ( Queryable . Select ) ,
1852
- new [ ] { source . ElementType , resultType } ,
1852
+ [ source . ElementType , resultType ] ,
1853
1853
source . Expression , Expression . Quote ( lambda ) ) ) ;
1854
1854
1855
1855
return source . Provider . CreateQuery ( optimized ) ;
@@ -1905,7 +1905,7 @@ public static IQueryable SelectMany(this IQueryable source, ParsingConfig config
1905
1905
{
1906
1906
Check . NotNull ( source ) ;
1907
1907
Check . NotNull ( config ) ;
1908
- Check . NotNull ( resultType , nameof ( resultType ) ) ;
1908
+ Check . NotNull ( resultType ) ;
1909
1909
Check . NotEmpty ( selector ) ;
1910
1910
1911
1911
return SelectManyInternal ( source , config , resultType , selector , args ) ;
@@ -1980,7 +1980,7 @@ public static IQueryable<TResult> SelectMany<TResult>(this IQueryable source, Pa
1980
1980
Check . NotEmpty ( selector ) ;
1981
1981
1982
1982
bool createParameterCtor = config . EvaluateGroupByAtDatabase || SupportsLinqToObjects ( config , source ) ;
1983
- LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( createParameterCtor , source . ElementType , null , selector , args ) ;
1983
+ LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , selector , args ) ;
1984
1984
1985
1985
//we have to adjust to lambda to return an IEnumerable<T> instead of whatever the actual property is.
1986
1986
Type inputType = source . Expression . Type . GetTypeInfo ( ) . GetGenericTypeArguments ( ) [ 0 ] ;
@@ -2096,12 +2096,12 @@ public static IQueryable SelectMany(
2096
2096
ParameterExpression xParameter = ParameterExpressionHelper . CreateParameterExpression ( source . ElementType , collectionParameterName , config . RenameEmptyParameterExpressionNames ) ;
2097
2097
ParameterExpression yParameter = ParameterExpressionHelper . CreateParameterExpression ( sourceLambdaResultType , resultParameterName , config . RenameEmptyParameterExpressionNames ) ;
2098
2098
2099
- LambdaExpression resultSelectLambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , new [ ] { xParameter , yParameter } , null , resultSelector , resultSelectorArgs ) ;
2099
+ LambdaExpression resultSelectLambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , [ xParameter , yParameter ] , null , resultSelector , resultSelectorArgs ) ;
2100
2100
Type resultLambdaResultType = resultSelectLambda . Body . Type ;
2101
2101
2102
2102
var optimized = OptimizeExpression ( Expression . Call (
2103
2103
typeof ( Queryable ) , nameof ( Queryable . SelectMany ) ,
2104
- new [ ] { source . ElementType , sourceLambdaResultType , resultLambdaResultType } ,
2104
+ [ source . ElementType , sourceLambdaResultType , resultLambdaResultType ] ,
2105
2105
source . Expression , Expression . Quote ( sourceSelectLambda ) , Expression . Quote ( resultSelectLambda ) )
2106
2106
) ;
2107
2107
@@ -2134,7 +2134,7 @@ public static dynamic Single(this IQueryable source)
2134
2134
{
2135
2135
Check . NotNull ( source ) ;
2136
2136
2137
- var optimized = OptimizeExpression ( Expression . Call ( typeof ( Queryable ) , nameof ( Queryable . Single ) , new [ ] { source . ElementType } , source . Expression ) ) ;
2137
+ var optimized = OptimizeExpression ( Expression . Call ( typeof ( Queryable ) , nameof ( Queryable . Single ) , [ source . ElementType ] , source . Expression ) ) ;
2138
2138
return source . Provider . Execute ( optimized ) ! ;
2139
2139
}
2140
2140
@@ -2205,7 +2205,7 @@ public static dynamic SingleOrDefault(this IQueryable source)
2205
2205
{
2206
2206
Check . NotNull ( source ) ;
2207
2207
2208
- var optimized = OptimizeExpression ( Expression . Call ( typeof ( Queryable ) , nameof ( Queryable . SingleOrDefault ) , new [ ] { source . ElementType } , source . Expression ) ) ;
2208
+ var optimized = OptimizeExpression ( Expression . Call ( typeof ( Queryable ) , nameof ( Queryable . SingleOrDefault ) , [ source . ElementType ] , source . Expression ) ) ;
2209
2209
return source . Provider . Execute ( optimized ) ! ;
2210
2210
}
2211
2211
@@ -2566,15 +2566,15 @@ internal static IOrderedQueryable InternalThenBy(IOrderedQueryable source, Parsi
2566
2566
{
2567
2567
queryExpr = Expression . Call (
2568
2568
typeof ( Queryable ) , dynamicOrdering . MethodName ,
2569
- new [ ] { source . ElementType , dynamicOrdering . Selector . Type } ,
2569
+ [ source . ElementType , dynamicOrdering . Selector . Type ] ,
2570
2570
queryExpr , Expression . Quote ( Expression . Lambda ( dynamicOrdering . Selector , parameters ) ) ) ;
2571
2571
}
2572
2572
else
2573
2573
{
2574
2574
var comparerGenericType = typeof ( IComparer < > ) . MakeGenericType ( dynamicOrdering . Selector . Type ) ;
2575
2575
queryExpr = Expression . Call (
2576
2576
typeof ( Queryable ) , dynamicOrdering . MethodName ,
2577
- new [ ] { source . ElementType , dynamicOrdering . Selector . Type } ,
2577
+ [ source . ElementType , dynamicOrdering . Selector . Type ] ,
2578
2578
queryExpr , Expression . Quote ( Expression . Lambda ( dynamicOrdering . Selector , parameters ) ) ,
2579
2579
Expression . Constant ( comparer , comparerGenericType ) ) ;
2580
2580
}
@@ -2653,7 +2653,7 @@ public static IQueryable Where(this IQueryable source, ParsingConfig config, str
2653
2653
bool createParameterCtor = SupportsLinqToObjects ( config , source ) ;
2654
2654
LambdaExpression lambda = DynamicExpressionParser . ParseLambda ( config , createParameterCtor , source . ElementType , null , predicate , args ) ;
2655
2655
2656
- var optimized = OptimizeExpression ( Expression . Call ( typeof ( Queryable ) , nameof ( Queryable . Where ) , new [ ] { source . ElementType } , source . Expression , Expression . Quote ( lambda ) ) ) ;
2656
+ var optimized = OptimizeExpression ( Expression . Call ( typeof ( Queryable ) , nameof ( Queryable . Where ) , [ source . ElementType ] , source . Expression , Expression . Quote ( lambda ) ) ) ;
2657
2657
return source . Provider . CreateQuery ( optimized ) ;
2658
2658
}
2659
2659
0 commit comments