Look up Queryable operator MethodInfos without MakeGenericMethod (#79717)
authorShay Rojansky <roji@roji.org>
Fri, 16 Dec 2022 09:18:07 +0000 (10:18 +0100)
committerGitHub <noreply@github.com>
Fri, 16 Dec 2022 09:18:07 +0000 (10:18 +0100)
For NativeAOT compatibility, better speed.

Closes #79199

50 files changed:
src/libraries/Common/tests/System/Linq/SkipTakeData.cs
src/libraries/System.Linq.Queryable/src/System.Linq.Queryable.csproj
src/libraries/System.Linq.Queryable/src/System/Linq/CachedReflection.cs [deleted file]
src/libraries/System.Linq.Queryable/src/System/Linq/Queryable.cs
src/libraries/System.Linq.Queryable/tests/AggregateTests.cs
src/libraries/System.Linq.Queryable/tests/AllTests.cs
src/libraries/System.Linq.Queryable/tests/AnyTests.cs
src/libraries/System.Linq.Queryable/tests/AverageTests.cs
src/libraries/System.Linq.Queryable/tests/CastTests.cs
src/libraries/System.Linq.Queryable/tests/ConcatTests.cs
src/libraries/System.Linq.Queryable/tests/ContainsTests.cs
src/libraries/System.Linq.Queryable/tests/CountTests.cs
src/libraries/System.Linq.Queryable/tests/DefaultIfEmptyTests.cs
src/libraries/System.Linq.Queryable/tests/DistinctTests.cs
src/libraries/System.Linq.Queryable/tests/EnumerableQueryTests.cs
src/libraries/System.Linq.Queryable/tests/ExceptTests.cs
src/libraries/System.Linq.Queryable/tests/FirstOrDefaultTests.cs
src/libraries/System.Linq.Queryable/tests/FirstTests.cs
src/libraries/System.Linq.Queryable/tests/GroupByTests.cs
src/libraries/System.Linq.Queryable/tests/GroupJoinTests.cs
src/libraries/System.Linq.Queryable/tests/IntersectTests.cs
src/libraries/System.Linq.Queryable/tests/JoinTests.cs
src/libraries/System.Linq.Queryable/tests/LastOrDefaultTests.cs
src/libraries/System.Linq.Queryable/tests/LastTests.cs
src/libraries/System.Linq.Queryable/tests/LongCountTests.cs
src/libraries/System.Linq.Queryable/tests/MaxTests.cs
src/libraries/System.Linq.Queryable/tests/MinTests.cs
src/libraries/System.Linq.Queryable/tests/OfTypeTests.cs
src/libraries/System.Linq.Queryable/tests/OrderByDescendingTests.cs
src/libraries/System.Linq.Queryable/tests/OrderByTests.cs
src/libraries/System.Linq.Queryable/tests/OrderDescendingTests.cs
src/libraries/System.Linq.Queryable/tests/OrderTests.cs
src/libraries/System.Linq.Queryable/tests/QueryFromExpressionTests.cs
src/libraries/System.Linq.Queryable/tests/Queryable.cs
src/libraries/System.Linq.Queryable/tests/ReverseTests.cs
src/libraries/System.Linq.Queryable/tests/SelectManyTests.cs
src/libraries/System.Linq.Queryable/tests/SelectTests.cs
src/libraries/System.Linq.Queryable/tests/SequenceEqualTests.cs
src/libraries/System.Linq.Queryable/tests/SingleOrDefaultTests.cs
src/libraries/System.Linq.Queryable/tests/SingleTests.cs
src/libraries/System.Linq.Queryable/tests/SkipTests.cs
src/libraries/System.Linq.Queryable/tests/SkipWhileTests.cs
src/libraries/System.Linq.Queryable/tests/SumTests.cs
src/libraries/System.Linq.Queryable/tests/TakeWhileTests.cs
src/libraries/System.Linq.Queryable/tests/ThenByDescendingTests.cs
src/libraries/System.Linq.Queryable/tests/ThenByTests.cs
src/libraries/System.Linq.Queryable/tests/TrimCompatibilityTests.cs
src/libraries/System.Linq.Queryable/tests/UnionTests.cs
src/libraries/System.Linq.Queryable/tests/WhereTests.cs
src/libraries/System.Linq.Queryable/tests/ZipTests.cs

index b5e6386..6d134c9 100644 (file)
@@ -30,7 +30,7 @@ namespace System.Linq.Tests
             return EnumerableData().Select(array =>
             {
                 var enumerable = (IEnumerable<int>)array[0];
-                return new object[] { enumerable.AsQueryable(), array[1] };
+                return new[] { enumerable.AsQueryable(), array[1] };
             });
         }
     }
index 75fb21c..5906a0a 100644 (file)
@@ -4,7 +4,6 @@
     <EnableAotAnalyzer>true</EnableAotAnalyzer>
   </PropertyGroup>
   <ItemGroup>
-    <Compile Include="System\Linq\CachedReflection.cs" />
     <Compile Include="System\Linq\EnumerableExecutor.cs" />
     <Compile Include="System\Linq\EnumerableQuery.cs" />
     <Compile Include="System\Linq\EnumerableRewriter.cs" />
diff --git a/src/libraries/System.Linq.Queryable/src/System/Linq/CachedReflection.cs b/src/libraries/System.Linq.Queryable/src/System/Linq/CachedReflection.cs
deleted file mode 100644 (file)
index 514580f..0000000
+++ /dev/null
@@ -1,1061 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq.Expressions;
-using System.Reflection;
-
-namespace System.Linq
-{
-    [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2060:MakeGenericMethod",
-        Justification = "The methods passed into MakeGenericMethod do not contain trim annotations.")]
-    internal static class CachedReflectionInfo
-    {
-        private static MethodInfo? s_Aggregate_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Aggregate_TSource_2(Type TSource) =>
-             (s_Aggregate_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, object, object>>, object>(Queryable.Aggregate).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Aggregate_TSource_TAccumulate_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Aggregate_TSource_TAccumulate_3(Type TSource, Type TAccumulate) =>
-             (s_Aggregate_TSource_TAccumulate_3 ??= new Func<IQueryable<object>, object, Expression<Func<object, object, object>>, object>(Queryable.Aggregate).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TAccumulate);
-
-        private static MethodInfo? s_Aggregate_TSource_TAccumulate_TResult_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Aggregate_TSource_TAccumulate_TResult_4(Type TSource, Type TAccumulate, Type TResult) =>
-             (s_Aggregate_TSource_TAccumulate_TResult_4 ??= new Func<IQueryable<object>, object, Expression<Func<object, object, object>>, Expression<Func<object, object>>, object>(Queryable.Aggregate).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TAccumulate, TResult);
-
-        private static MethodInfo? s_All_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo All_TSource_2(Type TSource) =>
-             (s_All_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, bool>(Queryable.All).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Any_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Any_TSource_1(Type TSource) =>
-             (s_Any_TSource_1 ??= new Func<IQueryable<object>, bool>(Queryable.Any).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Any_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Any_TSource_2(Type TSource) =>
-             (s_Any_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, bool>(Queryable.Any).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_Int32_1;
-
-        public static MethodInfo Average_Int32_1 =>
-             s_Average_Int32_1 ??= new Func<IQueryable<int>, double>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_NullableInt32_1;
-
-        public static MethodInfo Average_NullableInt32_1 =>
-             s_Average_NullableInt32_1 ??= new Func<IQueryable<int?>, double?>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_Int64_1;
-
-        public static MethodInfo Average_Int64_1 =>
-             s_Average_Int64_1 ??= new Func<IQueryable<long>, double>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_NullableInt64_1;
-
-        public static MethodInfo Average_NullableInt64_1 =>
-             s_Average_NullableInt64_1 ??= new Func<IQueryable<long?>, double?>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_Single_1;
-
-        public static MethodInfo Average_Single_1 =>
-             s_Average_Single_1 ??= new Func<IQueryable<float>, float>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_NullableSingle_1;
-
-        public static MethodInfo Average_NullableSingle_1 =>
-             s_Average_NullableSingle_1 ??= new Func<IQueryable<float?>, float?>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_Double_1;
-
-        public static MethodInfo Average_Double_1 =>
-             s_Average_Double_1 ??= new Func<IQueryable<double>, double>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_NullableDouble_1;
-
-        public static MethodInfo Average_NullableDouble_1 =>
-             s_Average_NullableDouble_1 ??= new Func<IQueryable<double?>, double?>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_Decimal_1;
-
-        public static MethodInfo Average_Decimal_1 =>
-             s_Average_Decimal_1 ??= new Func<IQueryable<decimal>, decimal>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_NullableDecimal_1;
-
-        public static MethodInfo Average_NullableDecimal_1 =>
-             s_Average_NullableDecimal_1 ??= new Func<IQueryable<decimal?>, decimal?>(Queryable.Average).GetMethodInfo();
-
-        private static MethodInfo? s_Average_Int32_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_Int32_TSource_2(Type TSource) =>
-             (s_Average_Int32_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, int>>, double>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_NullableInt32_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_NullableInt32_TSource_2(Type TSource) =>
-             (s_Average_NullableInt32_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, int?>>, double?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_Single_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_Single_TSource_2(Type TSource) =>
-             (s_Average_Single_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, float>>, float>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_NullableSingle_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_NullableSingle_TSource_2(Type TSource) =>
-             (s_Average_NullableSingle_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, float?>>, float?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_Int64_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_Int64_TSource_2(Type TSource) =>
-             (s_Average_Int64_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, long>>, double>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_NullableInt64_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_NullableInt64_TSource_2(Type TSource) =>
-             (s_Average_NullableInt64_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, long?>>, double?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_Double_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_Double_TSource_2(Type TSource) =>
-             (s_Average_Double_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, double>>, double>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_NullableDouble_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_NullableDouble_TSource_2(Type TSource) =>
-             (s_Average_NullableDouble_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, double?>>, double?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_Decimal_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_Decimal_TSource_2(Type TSource) =>
-             (s_Average_Decimal_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, decimal>>, decimal>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Average_NullableDecimal_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Average_NullableDecimal_TSource_2(Type TSource) =>
-             (s_Average_NullableDecimal_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, decimal?>>, decimal?>(Queryable.Average).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Cast_TResult_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Cast_TResult_1(Type TResult) =>
-             (s_Cast_TResult_1 ??= new Func<IQueryable, IQueryable<object>>(Queryable.Cast<object>).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TResult);
-
-        private static MethodInfo? s_Chunk_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Chunk_TSource_1(Type TSource) =>
-             (s_Chunk_TSource_1 ??= new Func<IQueryable<object>, int, IQueryable<object>>(Queryable.Chunk).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Concat_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Concat_TSource_2(Type TSource) =>
-             (s_Concat_TSource_2 ??= new Func<IQueryable<object>, IEnumerable<object>, IQueryable<object>>(Queryable.Concat).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Contains_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Contains_TSource_2(Type TSource) =>
-             (s_Contains_TSource_2 ??= new Func<IQueryable<object>, object, bool>(Queryable.Contains).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Contains_TSource_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Contains_TSource_3(Type TSource) =>
-             (s_Contains_TSource_3 ??= new Func<IQueryable<object>, object, IEqualityComparer<object>, bool>(Queryable.Contains).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Count_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Count_TSource_1(Type TSource) =>
-             (s_Count_TSource_1 ??= new Func<IQueryable<object>, int>(Queryable.Count).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Count_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Count_TSource_2(Type TSource) =>
-             (s_Count_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, int>(Queryable.Count).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_DefaultIfEmpty_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo DefaultIfEmpty_TSource_1(Type TSource) =>
-             (s_DefaultIfEmpty_TSource_1 ??= new Func<IQueryable<object>, IQueryable<object?>>(Queryable.DefaultIfEmpty).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_DefaultIfEmpty_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo DefaultIfEmpty_TSource_2(Type TSource) =>
-             (s_DefaultIfEmpty_TSource_2 ??= new Func<IQueryable<object>, object, IQueryable<object?>>(Queryable.DefaultIfEmpty).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Distinct_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Distinct_TSource_1(Type TSource) =>
-             (s_Distinct_TSource_1 ??= new Func<IQueryable<object>, IQueryable<object>>(Queryable.Distinct).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Distinct_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Distinct_TSource_2(Type TSource) =>
-             (s_Distinct_TSource_2 ??= new Func<IQueryable<object>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Distinct).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_DistinctBy_TSource_TKey_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo DistinctBy_TSource_TKey_2(Type TSource, Type TKey) =>
-             (s_DistinctBy_TSource_TKey_2 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IQueryable<object>>(Queryable.DistinctBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_DistinctBy_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo DistinctBy_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_DistinctBy_TSource_TKey_3 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.DistinctBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_ElementAt_Int32_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ElementAt_Int32_TSource_2(Type TSource) =>
-             (s_ElementAt_Int32_TSource_2 ??= new Func<IQueryable<object>, int, object>(Queryable.ElementAt).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_ElementAt_Index_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ElementAt_Index_TSource_2(Type TSource) =>
-             (s_ElementAt_Index_TSource_2 ??= new Func<IQueryable<object>, Index, object>(Queryable.ElementAt).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_ElementAtOrDefault_Int32_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ElementAtOrDefault_Int32_TSource_2(Type TSource) =>
-             (s_ElementAtOrDefault_Int32_TSource_2 ??= new Func<IQueryable<object>, int, object?>(Queryable.ElementAtOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_ElementAtOrDefault_Index_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ElementAtOrDefault_Index_TSource_2(Type TSource) =>
-             (s_ElementAtOrDefault_Index_TSource_2 ??= new Func<IQueryable<object>, Index, object?>(Queryable.ElementAtOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Except_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Except_TSource_2(Type TSource) =>
-             (s_Except_TSource_2 ??= new Func<IQueryable<object>, IEnumerable<object>, IQueryable<object>>(Queryable.Except).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Except_TSource_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Except_TSource_3(Type TSource) =>
-             (s_Except_TSource_3 ??= new Func<IQueryable<object>, IEnumerable<object>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Except).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_ExceptBy_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ExceptBy_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_ExceptBy_TSource_TKey_3 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, IQueryable<object>>(Queryable.ExceptBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_ExceptBy_TSource_TKey_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ExceptBy_TSource_TKey_4(Type TSource, Type TKey) =>
-             (s_ExceptBy_TSource_TKey_4 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.ExceptBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_First_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo First_TSource_1(Type TSource) =>
-             (s_First_TSource_1 ??= new Func<IQueryable<object>, object>(Queryable.First).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_First_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo First_TSource_2(Type TSource) =>
-             (s_First_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, object>(Queryable.First).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_FirstOrDefault_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo FirstOrDefault_TSource_1(Type TSource) =>
-             (s_FirstOrDefault_TSource_1 ??= new Func<IQueryable<object>, object?>(Queryable.FirstOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_FirstOrDefault_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo FirstOrDefault_TSource_2(Type TSource) =>
-             (s_FirstOrDefault_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, object?>(Queryable.FirstOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_FirstOrDefault_TSource_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo FirstOrDefault_TSource_3(Type TSource) =>
-            (s_FirstOrDefault_TSource_3 ??= new Func<IQueryable<object>, object, object>(Queryable.FirstOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-            .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_FirstOrDefault_TSource_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo FirstOrDefault_TSource_4(Type TSource) =>
-            (s_FirstOrDefault_TSource_4 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, object, object>(Queryable.FirstOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-            .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_GroupBy_TSource_TKey_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupBy_TSource_TKey_2(Type TSource, Type TKey) =>
-             (s_GroupBy_TSource_TKey_2 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IQueryable<IGrouping<object, object>>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_GroupBy_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupBy_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_GroupBy_TSource_TKey_3 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IEqualityComparer<object>, IQueryable<IGrouping<object, object>>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_GroupBy_TSource_TKey_TElement_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupBy_TSource_TKey_TElement_3(Type TSource, Type TKey, Type TElement) =>
-             (s_GroupBy_TSource_TKey_TElement_3 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, IQueryable<IGrouping<object, object>>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey, TElement);
-
-        private static MethodInfo? s_GroupBy_TSource_TKey_TElement_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupBy_TSource_TKey_TElement_4(Type TSource, Type TKey, Type TElement) =>
-             (s_GroupBy_TSource_TKey_TElement_4 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, IEqualityComparer<object>, IQueryable<IGrouping<object, object>>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey, TElement);
-
-        private static MethodInfo? s_GroupBy_TSource_TKey_TResult_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupBy_TSource_TKey_TResult_3(Type TSource, Type TKey, Type TResult) =>
-             (s_GroupBy_TSource_TKey_TResult_3 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IQueryable<object>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey, TResult);
-
-        private static MethodInfo? s_GroupBy_TSource_TKey_TResult_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupBy_TSource_TKey_TResult_4(Type TSource, Type TKey, Type TResult) =>
-             (s_GroupBy_TSource_TKey_TResult_4 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey, TResult);
-
-        private static MethodInfo? s_GroupBy_TSource_TKey_TElement_TResult_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupBy_TSource_TKey_TElement_TResult_4(Type TSource, Type TKey, Type TElement, Type TResult) =>
-             (s_GroupBy_TSource_TKey_TElement_TResult_4 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IQueryable<object>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey, TElement, TResult);
-
-        private static MethodInfo? s_GroupBy_TSource_TKey_TElement_TResult_5;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupBy_TSource_TKey_TElement_TResult_5(Type TSource, Type TKey, Type TElement, Type TResult) =>
-             (s_GroupBy_TSource_TKey_TElement_TResult_5 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.GroupBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey, TElement, TResult);
-
-        private static MethodInfo? s_GroupJoin_TOuter_TInner_TKey_TResult_5;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupJoin_TOuter_TInner_TKey_TResult_5(Type TOuter, Type TInner, Type TKey, Type TResult) =>
-             (s_GroupJoin_TOuter_TInner_TKey_TResult_5 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IQueryable<object>>(Queryable.GroupJoin).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TOuter, TInner, TKey, TResult);
-
-        private static MethodInfo? s_GroupJoin_TOuter_TInner_TKey_TResult_6;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo GroupJoin_TOuter_TInner_TKey_TResult_6(Type TOuter, Type TInner, Type TKey, Type TResult) =>
-             (s_GroupJoin_TOuter_TInner_TKey_TResult_6 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, IEnumerable<object>, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.GroupJoin).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TOuter, TInner, TKey, TResult);
-
-        private static MethodInfo? s_Intersect_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Intersect_TSource_2(Type TSource) =>
-             (s_Intersect_TSource_2 ??= new Func<IQueryable<object>, IEnumerable<object>, IQueryable<object>>(Queryable.Intersect).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Intersect_TSource_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Intersect_TSource_3(Type TSource) =>
-             (s_Intersect_TSource_3 ??= new Func<IQueryable<object>, IEnumerable<object>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Intersect).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_IntersectBy_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo IntersectBy_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_IntersectBy_TSource_TKey_3 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, IQueryable<object>>(Queryable.IntersectBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_IntersectBy_TSource_TKey_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo IntersectBy_TSource_TKey_4(Type TSource, Type TKey) =>
-             (s_IntersectBy_TSource_TKey_4 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.IntersectBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_Join_TOuter_TInner_TKey_TResult_5;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Join_TOuter_TInner_TKey_TResult_5(Type TOuter, Type TInner, Type TKey, Type TResult) =>
-             (s_Join_TOuter_TInner_TKey_TResult_5 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, object, object>>, IQueryable<object>>(Queryable.Join).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TOuter, TInner, TKey, TResult);
-
-        private static MethodInfo? s_Join_TOuter_TInner_TKey_TResult_6;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Join_TOuter_TInner_TKey_TResult_6(Type TOuter, Type TInner, Type TKey, Type TResult) =>
-             (s_Join_TOuter_TInner_TKey_TResult_6 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, Expression<Func<object, object>>, Expression<Func<object, object, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Join).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TOuter, TInner, TKey, TResult);
-
-        private static MethodInfo? s_Last_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Last_TSource_1(Type TSource) =>
-             (s_Last_TSource_1 ??= new Func<IQueryable<object>, object>(Queryable.Last).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Last_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Last_TSource_2(Type TSource) =>
-             (s_Last_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, object>(Queryable.Last).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_LastOrDefault_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo LastOrDefault_TSource_1(Type TSource) =>
-             (s_LastOrDefault_TSource_1 ??= new Func<IQueryable<object>, object?>(Queryable.LastOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_LastOrDefault_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo LastOrDefault_TSource_2(Type TSource) =>
-             (s_LastOrDefault_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, object?>(Queryable.LastOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_LastOrDefault_TSource_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo LastOrDefault_TSource_3(Type TSource) =>
-            (s_LastOrDefault_TSource_3 ??= new Func<IQueryable<object>, object, object>(Queryable.LastOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-            .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_LastOrDefault_TSource_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo LastOrDefault_TSource_4(Type TSource) =>
-            (s_LastOrDefault_TSource_4 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, object, object>(Queryable.LastOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-            .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_LongCount_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo LongCount_TSource_1(Type TSource) =>
-             (s_LongCount_TSource_1 ??= new Func<IQueryable<object>, long>(Queryable.LongCount).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_LongCount_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo LongCount_TSource_2(Type TSource) =>
-             (s_LongCount_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, long>(Queryable.LongCount).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Max_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Max_TSource_1(Type TSource) =>
-             (s_Max_TSource_1 ??= new Func<IQueryable<object>, object?>(Queryable.Max).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Max_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Max_TSource_2(Type TSource) =>
-             (s_Max_TSource_2 ??= new Func<IQueryable<object>, IComparer<object>, object?>(Queryable.Max).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Max_TSource_TResult_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Max_TSource_TResult_2(Type TSource, Type TResult) =>
-             (s_Max_TSource_TResult_2 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, object?>(Queryable.Max).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TResult);
-
-        private static MethodInfo? s_MaxBy_TSource_TKey_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo MaxBy_TSource_TKey_2(Type TSource, Type TKey) =>
-             (s_MaxBy_TSource_TKey_2 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, object?>(Queryable.MaxBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_MaxBy_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo MaxBy_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_MaxBy_TSource_TKey_3 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IComparer<object>, object?>(Queryable.MaxBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_Min_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Min_TSource_1(Type TSource) =>
-             (s_Min_TSource_1 ??= new Func<IQueryable<object>, object?>(Queryable.Min).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Min_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Min_TSource_2(Type TSource) =>
-             (s_Min_TSource_2 ??= new Func<IQueryable<object>, IComparer<object>, object?>(Queryable.Min).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Min_TSource_TResult_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Min_TSource_TResult_2(Type TSource, Type TResult) =>
-             (s_Min_TSource_TResult_2 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, object?>(Queryable.Min).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TResult);
-
-        private static MethodInfo? s_MinBy_TSource_TKey_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo MinBy_TSource_TKey_2(Type TSource, Type TKey) =>
-             (s_MinBy_TSource_TKey_2 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, object?>(Queryable.MinBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_MinBy_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo MinBy_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_MinBy_TSource_TKey_3 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IComparer<object>, object?>(Queryable.MinBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_OfType_TResult_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo OfType_TResult_1(Type TResult) =>
-             (s_OfType_TResult_1 ??= new Func<IQueryable, IQueryable<object>>(Queryable.OfType<object>).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TResult);
-
-        private static MethodInfo? s_Order_T_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Order_T_1(Type T) =>
-             (s_Order_T_1 ??= new Func<IQueryable<object>, IOrderedQueryable<object>>(Queryable.Order).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(T);
-
-        private static MethodInfo? s_Order_T_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Order_T_2(Type T) =>
-             (s_Order_T_2 ??= new Func<IQueryable<object>, IComparer<object>, IOrderedQueryable<object>>(Queryable.Order).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(T);
-
-        private static MethodInfo? s_OrderBy_TSource_TKey_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo OrderBy_TSource_TKey_2(Type TSource, Type TKey) =>
-             (s_OrderBy_TSource_TKey_2 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IOrderedQueryable<object>>(Queryable.OrderBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_OrderDescending_T_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo OrderDescending_T_1(Type T) =>
-             (s_OrderDescending_T_1 ??= new Func<IQueryable<object>, IOrderedQueryable<object>>(Queryable.OrderDescending).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(T);
-
-        private static MethodInfo? s_OrderDescending_T_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo OrderDescending_T_2(Type T) =>
-             (s_OrderDescending_T_2 ??= new Func<IQueryable<object>, IComparer<object>, IOrderedQueryable<object>>(Queryable.OrderDescending).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(T);
-
-        private static MethodInfo? s_OrderBy_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo OrderBy_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_OrderBy_TSource_TKey_3 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IComparer<object>, IOrderedQueryable<object>>(Queryable.OrderBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_OrderByDescending_TSource_TKey_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo OrderByDescending_TSource_TKey_2(Type TSource, Type TKey) =>
-             (s_OrderByDescending_TSource_TKey_2 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IOrderedQueryable<object>>(Queryable.OrderByDescending).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_OrderByDescending_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo OrderByDescending_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_OrderByDescending_TSource_TKey_3 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IComparer<object>, IOrderedQueryable<object>>(Queryable.OrderByDescending).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_Reverse_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Reverse_TSource_1(Type TSource) =>
-             (s_Reverse_TSource_1 ??= new Func<IQueryable<object>, IQueryable<object>>(Queryable.Reverse).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Select_TSource_TResult_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Select_TSource_TResult_2(Type TSource, Type TResult) =>
-             (s_Select_TSource_TResult_2 ??= new Func<IQueryable<object>, Expression<Func<object, object>>, IQueryable<object>>(Queryable.Select).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TResult);
-
-        private static MethodInfo? s_Select_Index_TSource_TResult_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Select_Index_TSource_TResult_2(Type TSource, Type TResult) =>
-             (s_Select_Index_TSource_TResult_2 ??= new Func<IQueryable<object>, Expression<Func<object, int, object>>, IQueryable<object>>(Queryable.Select).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TResult);
-
-        private static MethodInfo? s_SelectMany_TSource_TResult_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SelectMany_TSource_TResult_2(Type TSource, Type TResult) =>
-             (s_SelectMany_TSource_TResult_2 ??= new Func<IQueryable<object>, Expression<Func<object, IEnumerable<object>>>, IQueryable<object>>(Queryable.SelectMany).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TResult);
-
-        private static MethodInfo? s_SelectMany_Index_TSource_TResult_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SelectMany_Index_TSource_TResult_2(Type TSource, Type TResult) =>
-             (s_SelectMany_Index_TSource_TResult_2 ??= new Func<IQueryable<object>, Expression<Func<object, int, IEnumerable<object>>>, IQueryable<object>>(Queryable.SelectMany).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TResult);
-
-        private static MethodInfo? s_SelectMany_Index_TSource_TCollection_TResult_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SelectMany_Index_TSource_TCollection_TResult_3(Type TSource, Type TCollection, Type TResult) =>
-             (s_SelectMany_Index_TSource_TCollection_TResult_3 ??= new Func<IQueryable<object>, Expression<Func<object, int, IEnumerable<object>>>, Expression<Func<object, object, object>>, IQueryable<object>>(Queryable.SelectMany).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TCollection, TResult);
-
-        private static MethodInfo? s_SelectMany_TSource_TCollection_TResult_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SelectMany_TSource_TCollection_TResult_3(Type TSource, Type TCollection, Type TResult) =>
-             (s_SelectMany_TSource_TCollection_TResult_3 ??= new Func<IQueryable<object>, Expression<Func<object, IEnumerable<object>>>, Expression<Func<object, object, object>>, IQueryable<object>>(Queryable.SelectMany).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TCollection, TResult);
-
-        private static MethodInfo? s_SequenceEqual_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SequenceEqual_TSource_2(Type TSource) =>
-             (s_SequenceEqual_TSource_2 ??= new Func<IQueryable<object>, IEnumerable<object>, bool>(Queryable.SequenceEqual).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_SequenceEqual_TSource_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SequenceEqual_TSource_3(Type TSource) =>
-             (s_SequenceEqual_TSource_3 ??= new Func<IQueryable<object>, IEnumerable<object>, IEqualityComparer<object>, bool>(Queryable.SequenceEqual).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Single_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Single_TSource_1(Type TSource) =>
-             (s_Single_TSource_1 ??= new Func<IQueryable<object>, object>(Queryable.Single).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Single_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Single_TSource_2(Type TSource) =>
-             (s_Single_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, object>(Queryable.Single).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_SingleOrDefault_TSource_1;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SingleOrDefault_TSource_1(Type TSource) =>
-             (s_SingleOrDefault_TSource_1 ??= new Func<IQueryable<object>, object?>(Queryable.SingleOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_SingleOrDefault_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SingleOrDefault_TSource_2(Type TSource) =>
-             (s_SingleOrDefault_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, object?>(Queryable.SingleOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_SingleOrDefault_TSource_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SingleOrDefault_TSource_3(Type TSource) =>
-            (s_SingleOrDefault_TSource_3 ??= new Func<IQueryable<object>, object, object>(Queryable.SingleOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-             .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_SingleOrDefault_TSource_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SingleOrDefault_TSource_4(Type TSource) =>
-            (s_SingleOrDefault_TSource_4 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, object, object>(Queryable.SingleOrDefault).GetMethodInfo().GetGenericMethodDefinition())
-             .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Skip_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Skip_TSource_2(Type TSource) =>
-             (s_Skip_TSource_2 ??= new Func<IQueryable<object>, int, IQueryable<object>>(Queryable.Skip).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_SkipWhile_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SkipWhile_TSource_2(Type TSource) =>
-             (s_SkipWhile_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, IQueryable<object>>(Queryable.SkipWhile).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_SkipWhile_Index_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SkipWhile_Index_TSource_2(Type TSource) =>
-             (s_SkipWhile_Index_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, int, bool>>, IQueryable<object>>(Queryable.SkipWhile).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_Int32_1;
-
-        public static MethodInfo Sum_Int32_1 =>
-             s_Sum_Int32_1 ??= new Func<IQueryable<int>, int>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_NullableInt32_1;
-
-        public static MethodInfo Sum_NullableInt32_1 =>
-             s_Sum_NullableInt32_1 ??= new Func<IQueryable<int?>, int?>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_Int64_1;
-
-        public static MethodInfo Sum_Int64_1 =>
-             s_Sum_Int64_1 ??= new Func<IQueryable<long>, long>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_NullableInt64_1;
-
-        public static MethodInfo Sum_NullableInt64_1 =>
-             s_Sum_NullableInt64_1 ??= new Func<IQueryable<long?>, long?>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_Single_1;
-
-        public static MethodInfo Sum_Single_1 =>
-             s_Sum_Single_1 ??= new Func<IQueryable<float>, float>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_NullableSingle_1;
-
-        public static MethodInfo Sum_NullableSingle_1 =>
-             s_Sum_NullableSingle_1 ??= new Func<IQueryable<float?>, float?>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_Double_1;
-
-        public static MethodInfo Sum_Double_1 =>
-             s_Sum_Double_1 ??= new Func<IQueryable<double>, double>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_NullableDouble_1;
-
-        public static MethodInfo Sum_NullableDouble_1 =>
-             s_Sum_NullableDouble_1 ??= new Func<IQueryable<double?>, double?>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_Decimal_1;
-
-        public static MethodInfo Sum_Decimal_1 =>
-             s_Sum_Decimal_1 ??= new Func<IQueryable<decimal>, decimal>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_NullableDecimal_1;
-
-        public static MethodInfo Sum_NullableDecimal_1 =>
-             s_Sum_NullableDecimal_1 ??= new Func<IQueryable<decimal?>, decimal?>(Queryable.Sum).GetMethodInfo();
-
-        private static MethodInfo? s_Sum_NullableDecimal_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_NullableDecimal_TSource_2(Type TSource) =>
-             (s_Sum_NullableDecimal_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, decimal?>>, decimal?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_Int32_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_Int32_TSource_2(Type TSource) =>
-             (s_Sum_Int32_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, int>>, int>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_NullableInt32_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_NullableInt32_TSource_2(Type TSource) =>
-             (s_Sum_NullableInt32_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, int?>>, int?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_Int64_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_Int64_TSource_2(Type TSource) =>
-             (s_Sum_Int64_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, long>>, long>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_NullableInt64_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_NullableInt64_TSource_2(Type TSource) =>
-             (s_Sum_NullableInt64_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, long?>>, long?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_Single_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_Single_TSource_2(Type TSource) =>
-             (s_Sum_Single_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, float>>, float>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_NullableSingle_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_NullableSingle_TSource_2(Type TSource) =>
-             (s_Sum_NullableSingle_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, float?>>, float?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_Double_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_Double_TSource_2(Type TSource) =>
-             (s_Sum_Double_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, double>>, double>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_NullableDouble_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_NullableDouble_TSource_2(Type TSource) =>
-             (s_Sum_NullableDouble_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, double?>>, double?>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Sum_Decimal_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Sum_Decimal_TSource_2(Type TSource) =>
-             (s_Sum_Decimal_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, decimal>>, decimal>(Queryable.Sum).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Take_Int32_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Take_Int32_TSource_2(Type TSource) =>
-             (s_Take_Int32_TSource_2 ??= new Func<IQueryable<object>, int, IQueryable<object>>(Queryable.Take).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Take_Range_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Take_Range_TSource_2(Type TSource) =>
-             (s_Take_Range_TSource_2 ??= new Func<IQueryable<object>, Range, IQueryable<object>>(Queryable.Take).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_TakeWhile_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo TakeWhile_TSource_2(Type TSource) =>
-             (s_TakeWhile_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, IQueryable<object>>(Queryable.TakeWhile).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_TakeWhile_Index_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo TakeWhile_Index_TSource_2(Type TSource) =>
-             (s_TakeWhile_Index_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, int, bool>>, IQueryable<object>>(Queryable.TakeWhile).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_ThenBy_TSource_TKey_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ThenBy_TSource_TKey_2(Type TSource, Type TKey) =>
-             (s_ThenBy_TSource_TKey_2 ??= new Func<IOrderedQueryable<object>, Expression<Func<object, object>>, IOrderedQueryable<object>>(Queryable.ThenBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_ThenBy_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ThenBy_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_ThenBy_TSource_TKey_3 ??= new Func<IOrderedQueryable<object>, Expression<Func<object, object>>, IComparer<object>, IOrderedQueryable<object>>(Queryable.ThenBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_ThenByDescending_TSource_TKey_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ThenByDescending_TSource_TKey_2(Type TSource, Type TKey) =>
-             (s_ThenByDescending_TSource_TKey_2 ??= new Func<IOrderedQueryable<object>, Expression<Func<object, object>>, IOrderedQueryable<object>>(Queryable.ThenByDescending).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_ThenByDescending_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo ThenByDescending_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_ThenByDescending_TSource_TKey_3 ??= new Func<IOrderedQueryable<object>, Expression<Func<object, object>>, IComparer<object>, IOrderedQueryable<object>>(Queryable.ThenByDescending).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_Union_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Union_TSource_2(Type TSource) =>
-             (s_Union_TSource_2 ??= new Func<IQueryable<object>, IEnumerable<object>, IQueryable<object>>(Queryable.Union).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Union_TSource_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Union_TSource_3(Type TSource) =>
-             (s_Union_TSource_3 ??= new Func<IQueryable<object>, IEnumerable<object>, IEqualityComparer<object>, IQueryable<object>>(Queryable.Union).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_UnionBy_TSource_TKey_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo UnionBy_TSource_TKey_3(Type TSource, Type TKey) =>
-             (s_UnionBy_TSource_TKey_3 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, IQueryable<object>>(Queryable.UnionBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_UnionBy_TSource_TKey_4;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo UnionBy_TSource_TKey_4(Type TSource, Type TKey) =>
-             (s_UnionBy_TSource_TKey_4 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object>>, IEqualityComparer<object>, IQueryable<object>>(Queryable.UnionBy).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource, TKey);
-
-        private static MethodInfo? s_Where_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Where_TSource_2(Type TSource) =>
-             (s_Where_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, bool>>, IQueryable<object>>(Queryable.Where).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Where_Index_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Where_Index_TSource_2(Type TSource) =>
-             (s_Where_Index_TSource_2 ??= new Func<IQueryable<object>, Expression<Func<object, int, bool>>, IQueryable<object>>(Queryable.Where).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Zip_TFirst_TSecond_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Zip_TFirst_TSecond_2(Type TFirst, Type TSecond) =>
-            (s_Zip_TFirst_TSecond_2 ??= new Func<IQueryable<object>, IEnumerable<object>, IQueryable<(object, object)>>(Queryable.Zip).GetMethodInfo().GetGenericMethodDefinition())
-            .MakeGenericMethod(TFirst, TSecond);
-
-        private static MethodInfo? s_Zip_TFirst_TSecond_TResult_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Zip_TFirst_TSecond_TResult_3(Type TFirst, Type TSecond, Type TResult) =>
-             (s_Zip_TFirst_TSecond_TResult_3 ??= new Func<IQueryable<object>, IEnumerable<object>, Expression<Func<object, object, object>>, IQueryable<object>>(Queryable.Zip).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TFirst, TSecond, TResult);
-
-        private static MethodInfo? s_Zip_TFirst_TSecond_TThird_3;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Zip_TFirst_TSecond_TThird_3(Type TFirst, Type TSecond, Type TThird) =>
-             (s_Zip_TFirst_TSecond_TThird_3 ??= new Func<IQueryable<object>, IEnumerable<object>, IEnumerable<object>, IQueryable<(object, object, object)>>(Queryable.Zip).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TFirst, TSecond, TThird);
-
-
-        private static MethodInfo? s_SkipLast_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo SkipLast_TSource_2(Type TSource) =>
-             (s_SkipLast_TSource_2 ??= new Func<IQueryable<object>, int, IQueryable<object>>(Queryable.SkipLast).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_TakeLast_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo TakeLast_TSource_2(Type TSource) =>
-             (s_TakeLast_TSource_2 ??= new Func<IQueryable<object>, int, IQueryable<object>>(Queryable.TakeLast).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Append_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Append_TSource_2(Type TSource) =>
-             (s_Append_TSource_2 ??= new Func<IQueryable<object>, object, IQueryable<object>>(Queryable.Append).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-
-        private static MethodInfo? s_Prepend_TSource_2;
-
-        [RequiresDynamicCode("Calls System.Reflection.MethodInfo.MakeGenericMethod(params Type[])")]
-        public static MethodInfo Prepend_TSource_2(Type TSource) =>
-             (s_Prepend_TSource_2 ??= new Func<IQueryable<object>, object, IQueryable<object>>(Queryable.Prepend).GetMethodInfo().GetGenericMethodDefinition())
-              .MakeGenericMethod(TSource);
-    }
-}
index 3438995..a43ec6c 100644 (file)
@@ -11,7 +11,7 @@ namespace System.Linq
     public static class Queryable
     {
         internal const string InMemoryQueryableExtensionMethodsRequiresUnreferencedCode = "Enumerating in-memory collections as IQueryable can require unreferenced code because expressions referencing IQueryable extension methods can get rebound to IEnumerable extension methods. The IEnumerable extension methods could be trimmed causing the application to fail at runtime.";
-        internal const string InMemoryQueryableExtensionMethodsRequiresDynamicCode = "Enumerating collections as IQueryable can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.";
+        internal const string InMemoryQueryableExtensionMethodsRequiresDynamicCode = "Enumerating in-memory collections as IQueryable can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.";
 
         [RequiresUnreferencedCode(InMemoryQueryableExtensionMethodsRequiresUnreferencedCode)]
         [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
@@ -43,7 +43,6 @@ namespace System.Linq
         }
 
         [DynamicDependency("Where`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -52,13 +51,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Where_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, IQueryable<TSource>>(Where).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("Where`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -67,13 +64,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Where_Index_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int, bool>>, IQueryable<TSource>>(Where).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("OfType`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> OfType<TResult>(this IQueryable source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -81,11 +76,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.OfType_TResult_1(typeof(TResult)), source.Expression));
+                    new Func<IQueryable, IQueryable<TResult>>(OfType<TResult>).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Cast`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> Cast<TResult>(this IQueryable source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -93,11 +88,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Cast_TResult_1(typeof(TResult)), source.Expression));
+                    new Func<IQueryable, IQueryable<TResult>>(Cast<TResult>).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Select`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> Select<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -106,13 +101,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Select_TSource_TResult_2(typeof(TSource), typeof(TResult)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TResult>>, IQueryable<TResult>>(Select).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Select`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> Select<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, int, TResult>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -121,13 +114,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Select_Index_TSource_TResult_2(typeof(TSource), typeof(TResult)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int, TResult>>, IQueryable<TResult>>(Select).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("SelectMany`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> SelectMany<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -136,13 +127,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SelectMany_TSource_TResult_2(typeof(TSource), typeof(TResult)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, IEnumerable<TResult>>>, IQueryable<TResult>>(SelectMany).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("SelectMany`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> SelectMany<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, int, IEnumerable<TResult>>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -151,13 +140,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SelectMany_Index_TSource_TResult_2(typeof(TSource), typeof(TResult)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int, IEnumerable<TResult>>>, IQueryable<TResult>>(SelectMany).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("SelectMany`3", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, int, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -167,13 +154,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SelectMany_Index_TSource_TCollection_TResult_3(typeof(TSource), typeof(TCollection), typeof(TResult)),
-                    source.Expression, Expression.Quote(collectionSelector), Expression.Quote(resultSelector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int, IEnumerable<TCollection>>>, Expression<Func<TSource, TCollection, TResult>>, IQueryable<TResult>>(SelectMany).Method,
+                    source.Expression, Expression.Quote(collectionSelector), Expression.Quote(resultSelector)));
         }
 
         [DynamicDependency("SelectMany`3", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -183,9 +168,8 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SelectMany_TSource_TCollection_TResult_3(typeof(TSource), typeof(TCollection), typeof(TResult)),
-                    source.Expression, Expression.Quote(collectionSelector), Expression.Quote(resultSelector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, IEnumerable<TCollection>>>, Expression<Func<TSource, TCollection, TResult>>, IQueryable<TResult>>(SelectMany).Method,
+                    source.Expression, Expression.Quote(collectionSelector), Expression.Quote(resultSelector)));
         }
 
         private static Expression GetSourceExpression<TSource>(IEnumerable<TSource> source)
@@ -195,7 +179,6 @@ namespace System.Linq
         }
 
         [DynamicDependency("Join`4", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector)
         {
             ArgumentNullException.ThrowIfNull(outer);
@@ -207,11 +190,11 @@ namespace System.Linq
             return outer.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Join_TOuter_TInner_TKey_TResult_5(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), Expression.Quote(outerKeySelector), Expression.Quote(innerKeySelector), Expression.Quote(resultSelector)));
+                    new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>, IQueryable<TResult>>(Join).Method,
+                    outer.Expression, GetSourceExpression(inner), Expression.Quote(outerKeySelector), Expression.Quote(innerKeySelector), Expression.Quote(resultSelector)));
         }
 
         [DynamicDependency("Join`4", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(outer);
@@ -223,11 +206,11 @@ namespace System.Linq
             return outer.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Join_TOuter_TInner_TKey_TResult_6(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), Expression.Quote(outerKeySelector), Expression.Quote(innerKeySelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+                    new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, TInner, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(Join).Method,
+                    outer.Expression, GetSourceExpression(inner), Expression.Quote(outerKeySelector), Expression.Quote(innerKeySelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         [DynamicDependency("GroupJoin`4", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector)
         {
             ArgumentNullException.ThrowIfNull(outer);
@@ -239,11 +222,11 @@ namespace System.Linq
             return outer.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupJoin_TOuter_TInner_TKey_TResult_5(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), Expression.Quote(outerKeySelector), Expression.Quote(innerKeySelector), Expression.Quote(resultSelector)));
+                    new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>, IQueryable<TResult>>(GroupJoin).Method,
+                    outer.Expression, GetSourceExpression(inner), Expression.Quote(outerKeySelector), Expression.Quote(innerKeySelector), Expression.Quote(resultSelector)));
         }
 
         [DynamicDependency("GroupJoin`4", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IQueryable<TOuter> outer, IEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IEnumerable<TInner>, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(outer);
@@ -255,7 +238,8 @@ namespace System.Linq
             return outer.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupJoin_TOuter_TInner_TKey_TResult_6(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), Expression.Quote(outerKeySelector), Expression.Quote(innerKeySelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+                    new Func<IQueryable<TOuter>, IEnumerable<TInner>, Expression<Func<TOuter, TKey>>, Expression<Func<TInner, TKey>>, Expression<Func<TOuter, IEnumerable<TInner>, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(GroupJoin).Method,
+                    outer.Expression, GetSourceExpression(inner), Expression.Quote(outerKeySelector), Expression.Quote(innerKeySelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         /// <summary>
@@ -283,7 +267,6 @@ namespace System.Linq
         /// The expected behavior is that it sorts the elements of <paramref name="source"/> by itself.
         /// </remarks>
         [DynamicDependency("Order`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<T> Order<T>(this IQueryable<T> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -291,9 +274,8 @@ namespace System.Linq
             return (IOrderedQueryable<T>)source.Provider.CreateQuery<T>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Order_T_1(typeof(T)),
-                    source.Expression
-                    ));
+                    new Func<IQueryable<T>, IOrderedQueryable<T>>(Order).Method,
+                    source.Expression));
         }
 
         /// <summary>
@@ -322,7 +304,6 @@ namespace System.Linq
         /// The expected behavior is that it sorts the elements of <paramref name="source"/> by itself.
         /// </remarks>
         [DynamicDependency("Order`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<T> Order<T>(this IQueryable<T> source, IComparer<T> comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -330,13 +311,11 @@ namespace System.Linq
             return (IOrderedQueryable<T>)source.Provider.CreateQuery<T>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Order_T_2(typeof(T)),
-                    source.Expression, Expression.Constant(comparer, typeof(IComparer<T>))
-                    ));
+                    new Func<IQueryable<T>, IComparer<T>, IOrderedQueryable<T>>(Order).Method,
+                    source.Expression, Expression.Constant(comparer, typeof(IComparer<T>))));
         }
 
         [DynamicDependency("OrderBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -345,13 +324,11 @@ namespace System.Linq
             return (IOrderedQueryable<TSource>)source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.OrderBy_TSource_TKey_2(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IOrderedQueryable<TSource>>(OrderBy).Method,
+                    source.Expression, Expression.Quote(keySelector)));
         }
 
         [DynamicDependency("OrderBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -360,9 +337,8 @@ namespace System.Linq
             return (IOrderedQueryable<TSource>)source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.OrderBy_TSource_TKey_3(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(OrderBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))));
         }
 
         /// <summary>
@@ -390,7 +366,6 @@ namespace System.Linq
         /// The expected behavior is that it sorts the elements of <paramref name="source"/> by itself.
         /// </remarks>
         [DynamicDependency("OrderDescending`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<T> OrderDescending<T>(this IQueryable<T> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -398,9 +373,8 @@ namespace System.Linq
             return (IOrderedQueryable<T>)source.Provider.CreateQuery<T>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.OrderDescending_T_1(typeof(T)),
-                    source.Expression
-                    ));
+                    new Func<IQueryable<T>, IOrderedQueryable<T>>(OrderDescending).Method,
+                    source.Expression));
         }
 
         /// <summary>
@@ -429,7 +403,6 @@ namespace System.Linq
         /// The expected behavior is that it sorts the elements of <paramref name="source"/> by itself.
         /// </remarks>
         [DynamicDependency("OrderDescending`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<T> OrderDescending<T>(this IQueryable<T> source, IComparer<T> comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -437,13 +410,11 @@ namespace System.Linq
             return (IOrderedQueryable<T>)source.Provider.CreateQuery<T>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.OrderDescending_T_2(typeof(T)),
-                    source.Expression, Expression.Constant(comparer, typeof(IComparer<T>))
-                    ));
+                    new Func<IQueryable<T>, IComparer<T>, IOrderedQueryable<T>>(OrderDescending).Method,
+                    source.Expression, Expression.Constant(comparer, typeof(IComparer<T>))));
         }
 
         [DynamicDependency("OrderByDescending`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -452,13 +423,11 @@ namespace System.Linq
             return (IOrderedQueryable<TSource>)source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.OrderByDescending_TSource_TKey_2(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IOrderedQueryable<TSource>>(OrderByDescending).Method,
+                    source.Expression, Expression.Quote(keySelector)));
         }
 
         [DynamicDependency("OrderByDescending`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -467,13 +436,11 @@ namespace System.Linq
             return (IOrderedQueryable<TSource>)source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.OrderByDescending_TSource_TKey_3(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(OrderByDescending).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))));
         }
 
         [DynamicDependency("ThenBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -482,13 +449,11 @@ namespace System.Linq
             return (IOrderedQueryable<TSource>)source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ThenBy_TSource_TKey_2(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector)
-                    ));
+                    new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IOrderedQueryable<TSource>>(ThenBy).Method,
+                    source.Expression, Expression.Quote(keySelector)));
         }
 
         [DynamicDependency("ThenBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -497,13 +462,11 @@ namespace System.Linq
             return (IOrderedQueryable<TSource>)source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ThenBy_TSource_TKey_3(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))
-                    ));
+                    new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(ThenBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))));
         }
 
         [DynamicDependency("ThenByDescending`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -512,13 +475,11 @@ namespace System.Linq
             return (IOrderedQueryable<TSource>)source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ThenByDescending_TSource_TKey_2(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector)
-                    ));
+                    new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IOrderedQueryable<TSource>>(ThenByDescending).Method,
+                    source.Expression, Expression.Quote(keySelector)));
         }
 
         [DynamicDependency("ThenByDescending`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -527,13 +488,11 @@ namespace System.Linq
             return (IOrderedQueryable<TSource>)source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ThenByDescending_TSource_TKey_3(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))
-                    ));
+                    new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(ThenByDescending).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))));
         }
 
         [DynamicDependency("Take`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Take<TSource>(this IQueryable<TSource> source, int count)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -541,9 +500,8 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Take_Int32_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(count)
-                    ));
+                    new Func<IQueryable<TSource>, int, IQueryable<TSource>>(Take).Method,
+                    source.Expression, Expression.Constant(count)));
         }
 
         /// <summary>Returns a specified range of contiguous elements from a sequence.</summary>
@@ -553,7 +511,6 @@ namespace System.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         /// <returns>An <see cref="IQueryable{T}" /> that contains the specified <paramref name="range" /> of elements from the <paramref name="source" /> sequence.</returns>
         [DynamicDependency("Take`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Take<TSource>(this IQueryable<TSource> source, Range range)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -561,13 +518,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Take_Range_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(range)
-                    ));
+                    new Func<IQueryable<TSource>, Range, IQueryable<TSource>>(Take).Method,
+                    source.Expression, Expression.Constant(range)));
         }
 
         [DynamicDependency("TakeWhile`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> TakeWhile<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -576,13 +531,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.TakeWhile_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, IQueryable<TSource>>(TakeWhile).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("TakeWhile`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> TakeWhile<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -591,13 +544,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.TakeWhile_Index_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int, bool>>, IQueryable<TSource>>(TakeWhile).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("Skip`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Skip<TSource>(this IQueryable<TSource> source, int count)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -605,13 +556,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Skip_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(count)
-                    ));
+                    new Func<IQueryable<TSource>, int, IQueryable<TSource>>(Skip).Method,
+                    source.Expression, Expression.Constant(count)));
         }
 
         [DynamicDependency("SkipWhile`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> SkipWhile<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -620,13 +569,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SkipWhile_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, IQueryable<TSource>>(SkipWhile).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("SkipWhile`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> SkipWhile<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -635,13 +582,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SkipWhile_Index_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int, bool>>, IQueryable<TSource>>(SkipWhile).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("GroupBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -650,13 +595,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<IGrouping<TKey, TSource>>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupBy_TSource_TKey_2(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IQueryable<IGrouping<TKey, TSource>>>(GroupBy).Method,
+                    source.Expression, Expression.Quote(keySelector)));
         }
 
         [DynamicDependency("GroupBy`3", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -666,13 +609,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<IGrouping<TKey, TElement>>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupBy_TSource_TKey_TElement_3(typeof(TSource), typeof(TKey), typeof(TElement)),
-                    source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, IQueryable<IGrouping<TKey, TElement>>>(GroupBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector)));
         }
 
         [DynamicDependency("GroupBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -681,13 +622,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<IGrouping<TKey, TSource>>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupBy_TSource_TKey_3(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<IGrouping<TKey, TSource>>>(GroupBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         [DynamicDependency("GroupBy`3", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -697,11 +636,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<IGrouping<TKey, TElement>>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupBy_TSource_TKey_TElement_4(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, IEqualityComparer<TKey>, IQueryable<IGrouping<TKey, TElement>>>(GroupBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         [DynamicDependency("GroupBy`4", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -712,11 +651,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupBy_TSource_TKey_TElement_TResult_4(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Quote(resultSelector)));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, Expression<Func<TKey, IEnumerable<TElement>, TResult>>, IQueryable<TResult>>(GroupBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Quote(resultSelector)));
         }
 
         [DynamicDependency("GroupBy`3", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -726,13 +665,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupBy_TSource_TKey_TResult_3(typeof(TSource), typeof(TKey), typeof(TResult)),
-                    source.Expression, Expression.Quote(keySelector), Expression.Quote(resultSelector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>, IQueryable<TResult>>(GroupBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Quote(resultSelector)));
         }
 
         [DynamicDependency("GroupBy`3", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IEnumerable<TSource>, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -742,11 +679,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupBy_TSource_TKey_TResult_4(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, Expression.Quote(keySelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TKey, IEnumerable<TSource>, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(GroupBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         [DynamicDependency("GroupBy`4", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IEnumerable<TElement>, TResult>> resultSelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -757,11 +694,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.GroupBy_TSource_TKey_TElement_TResult_5(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, Expression<Func<TSource, TElement>>, Expression<Func<TKey, IEnumerable<TElement>, TResult>>, IEqualityComparer<TKey>, IQueryable<TResult>>(GroupBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         [DynamicDependency("Distinct`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Distinct<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -769,11 +706,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Distinct_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, IQueryable<TSource>>(Distinct).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Distinct`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Distinct<TSource>(this IQueryable<TSource> source, IEqualityComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -781,9 +718,8 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Distinct_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))
-                    ));
+                    new Func<IQueryable<TSource>, IEqualityComparer<TSource>, IQueryable<TSource>>(Distinct).Method,
+                    source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
         }
 
         /// <summary>Returns distinct elements from a sequence according to a specified key selector function.</summary>
@@ -794,7 +730,6 @@ namespace System.Linq
         /// <returns>An <see cref="IQueryable{T}" /> that contains distinct elements from the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         [DynamicDependency("DistinctBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> DistinctBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -803,9 +738,8 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.DistinctBy_TSource_TKey_2(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(DistinctBy).Method,
+                    source.Expression, Expression.Quote(keySelector)));
         }
 
         /// <summary>Returns distinct elements from a sequence according to a specified key selector function.</summary>
@@ -817,7 +751,6 @@ namespace System.Linq
         /// <returns>An <see cref="IQueryable{T}" /> that contains distinct elements from the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         [DynamicDependency("DistinctBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> DistinctBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -826,9 +759,8 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.DistinctBy_TSource_TKey_3(typeof(TSource), typeof(TKey)),
-                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(DistinctBy).Method,
+                    source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         /// <summary>Split the elements of a sequence into chunks of size at most <paramref name="size"/>.</summary>
@@ -843,7 +775,6 @@ namespace System.Linq
         /// <para>The last chunk will contain the remaining elements and may be of a smaller size.</para>
         /// </remarks>
         [DynamicDependency("Chunk`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource[]> Chunk<TSource>(this IQueryable<TSource> source, int size)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -851,13 +782,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource[]>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Chunk_TSource_1(typeof(TSource)),
-                    source.Expression, Expression.Constant(size)
-                    ));
+                    new Func<IQueryable<TSource>, int, IQueryable<TSource[]>>(Chunk).Method,
+                    source.Expression, Expression.Constant(size)));
         }
 
         [DynamicDependency("Concat`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Concat<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -866,13 +795,11 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Concat_TSource_2(typeof(TSource)),
-                    source1.Expression, GetSourceExpression(source2)
-                    ));
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, IQueryable<TSource>>(Concat).Method,
+                    source1.Expression, GetSourceExpression(source2)));
         }
 
         [DynamicDependency("Zip`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<(TFirst First, TSecond Second)> Zip<TFirst, TSecond>(this IQueryable<TFirst> source1, IEnumerable<TSecond> source2)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -881,12 +808,11 @@ namespace System.Linq
             return source1.Provider.CreateQuery<(TFirst, TSecond)>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Zip_TFirst_TSecond_2(typeof(TFirst), typeof(TSecond)),
+                    new Func<IQueryable<TFirst>, IEnumerable<TSecond>, IQueryable<(TFirst, TSecond)>>(Zip).Method,
                     source1.Expression, GetSourceExpression(source2)));
         }
 
         [DynamicDependency("Zip`3", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TResult> Zip<TFirst, TSecond, TResult>(this IQueryable<TFirst> source1, IEnumerable<TSecond> source2, Expression<Func<TFirst, TSecond, TResult>> resultSelector)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -896,9 +822,8 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Zip_TFirst_TSecond_TResult_3(typeof(TFirst), typeof(TSecond), typeof(TResult)),
-                    source1.Expression, GetSourceExpression(source2), Expression.Quote(resultSelector)
-                    ));
+                    new Func<IQueryable<TFirst>, IEnumerable<TSecond>, Expression<Func<TFirst, TSecond, TResult>>, IQueryable<TResult>>(Zip).Method,
+                    source1.Expression, GetSourceExpression(source2), Expression.Quote(resultSelector)));
         }
 
         /// <summary>
@@ -912,7 +837,6 @@ namespace System.Linq
         /// <param name="source3">The third sequence to merge.</param>
         /// <returns>A sequence of tuples with elements taken from the first, second and third sequences, in that order.</returns>
         [DynamicDependency("Zip`3", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<(TFirst First, TSecond Second, TThird Third)> Zip<TFirst, TSecond, TThird>(this IQueryable<TFirst> source1, IEnumerable<TSecond> source2, IEnumerable<TThird> source3)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -922,13 +846,11 @@ namespace System.Linq
             return source1.Provider.CreateQuery<(TFirst, TSecond, TThird)>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Zip_TFirst_TSecond_TThird_3(typeof(TFirst), typeof(TSecond), typeof(TThird)),
-                    source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3)
-                    ));
+                    new Func<IQueryable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>, IQueryable<(TFirst, TSecond, TThird)>>(Zip).Method,
+                    source1.Expression, GetSourceExpression(source2), GetSourceExpression(source3)));
         }
 
         [DynamicDependency("Union`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Union<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -937,13 +859,11 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Union_TSource_2(typeof(TSource)),
-                    source1.Expression, GetSourceExpression(source2)
-                    ));
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, IQueryable<TSource>>(Union).Method,
+                    source1.Expression, GetSourceExpression(source2)));
         }
 
         [DynamicDependency("Union`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Union<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -952,11 +872,10 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Union_TSource_3(typeof(TSource)),
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>, IQueryable<TSource>>(Union).Method,
                     source1.Expression,
                     GetSourceExpression(source2),
-                    Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))
-                    ));
+                    Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
         }
 
         /// <summary>Produces the set union of two sequences according to a specified key selector function.</summary>
@@ -968,7 +887,6 @@ namespace System.Linq
         /// <returns>An <see cref="IQueryable{T}" /> that contains the elements from both input sequences, excluding duplicates.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source1" /> or <paramref name="source2" /> is <see langword="null" />.</exception>
         [DynamicDependency("UnionBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> UnionBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TSource> source2, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -978,9 +896,8 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.UnionBy_TSource_TKey_3(typeof(TSource), typeof(TKey)),
-                    source1.Expression, GetSourceExpression(source2), Expression.Quote(keySelector)
-                    ));
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(UnionBy).Method,
+                    source1.Expression, GetSourceExpression(source2), Expression.Quote(keySelector)));
         }
 
         /// <summary>Produces the set union of two sequences according to a specified key selector function.</summary>
@@ -993,7 +910,6 @@ namespace System.Linq
         /// <returns>An <see cref="IQueryable{T}" /> that contains the elements from both input sequences, excluding duplicates.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source1" /> or <paramref name="source2" /> is <see langword="null" />.</exception>
         [DynamicDependency("UnionBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> UnionBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TSource> source2, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1003,16 +919,14 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.UnionBy_TSource_TKey_4(typeof(TSource), typeof(TKey)),
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(UnionBy).Method,
                     source1.Expression,
                     GetSourceExpression(source2),
                     Expression.Quote(keySelector),
-                    Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))
-                    ));
+                    Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         [DynamicDependency("Intersect`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Intersect<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1021,13 +935,11 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Intersect_TSource_2(typeof(TSource)),
-                    source1.Expression, GetSourceExpression(source2)
-                    ));
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, IQueryable<TSource>>(Intersect).Method,
+                    source1.Expression, GetSourceExpression(source2)));
         }
 
         [DynamicDependency("Intersect`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Intersect<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1036,11 +948,10 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Intersect_TSource_3(typeof(TSource)),
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>, IQueryable<TSource>>(Intersect).Method,
                     source1.Expression,
                     GetSourceExpression(source2),
-                    Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))
-                    ));
+                    Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
         }
 
         /// <summary>Produces the set intersection of two sequences according to a specified key selector function.</summary>
@@ -1052,7 +963,6 @@ namespace System.Linq
         /// <returns>A sequence that contains the elements that form the set intersection of two sequences.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source1" /> or <paramref name="source2" /> is <see langword="null" />.</exception>
         [DynamicDependency("IntersectBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> IntersectBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TKey> source2, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1062,11 +972,10 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.IntersectBy_TSource_TKey_3(typeof(TSource), typeof(TKey)),
+                    new Func<IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(IntersectBy).Method,
                     source1.Expression,
                     GetSourceExpression(source2),
-                    Expression.Quote(keySelector)
-                    ));
+                    Expression.Quote(keySelector)));
         }
 
         /// <summary>Produces the set intersection of two sequences according to a specified key selector function.</summary>
@@ -1079,7 +988,6 @@ namespace System.Linq
         /// <returns>A sequence that contains the elements that form the set intersection of two sequences.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source1" /> or <paramref name="source2" /> is <see langword="null" />.</exception>
         [DynamicDependency("IntersectBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> IntersectBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TKey> source2, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1089,16 +997,14 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.IntersectBy_TSource_TKey_4(typeof(TSource), typeof(TKey)),
+                    new Func<IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(IntersectBy).Method,
                     source1.Expression,
                     GetSourceExpression(source2),
                     Expression.Quote(keySelector),
-                    Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))
-                    ));
+                    Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         [DynamicDependency("Except`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Except<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1107,13 +1013,11 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Except_TSource_2(typeof(TSource)),
-                    source1.Expression, GetSourceExpression(source2)
-                    ));
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, IQueryable<TSource>>(Except).Method,
+                    source1.Expression, GetSourceExpression(source2)));
         }
 
         [DynamicDependency("Except`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Except<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1122,11 +1026,10 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Except_TSource_3(typeof(TSource)),
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>, IQueryable<TSource>>(Except).Method,
                     source1.Expression,
                     GetSourceExpression(source2),
-                    Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))
-                    ));
+                    Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
         }
 
         /// <summary>
@@ -1139,7 +1042,6 @@ namespace System.Linq
         /// <param name="keySelector">A function to extract the key for each element.</param>
         /// <returns>A <see cref="IQueryable{TSource}" /> that contains the set difference of the elements of two sequences.</returns>
         [DynamicDependency("ExceptBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> ExceptBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TKey> source2, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1149,11 +1051,10 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ExceptBy_TSource_TKey_3(typeof(TSource), typeof(TKey)),
+                    new Func<IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(ExceptBy).Method,
                     source1.Expression,
                     GetSourceExpression(source2),
-                    Expression.Quote(keySelector)
-                    ));
+                    Expression.Quote(keySelector)));
         }
 
         /// <summary>
@@ -1167,7 +1068,6 @@ namespace System.Linq
         /// <param name="comparer">An <see cref="IEqualityComparer{TKey}" /> to compare keys.</param>
         /// <returns>A <see cref="IQueryable{TSource}" /> that contains the set difference of the elements of two sequences.</returns>
         [DynamicDependency("ExceptBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> ExceptBy<TSource, TKey>(this IQueryable<TSource> source1, IEnumerable<TKey> source2, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1177,16 +1077,14 @@ namespace System.Linq
             return source1.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ExceptBy_TSource_TKey_4(typeof(TSource), typeof(TKey)),
+                    new Func<IQueryable<TSource>, IEnumerable<TKey>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(ExceptBy).Method,
                     source1.Expression,
                     GetSourceExpression(source2),
                     Expression.Quote(keySelector),
-                    Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))
-                    ));
+                    Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
         }
 
         [DynamicDependency("First`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource First<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1194,11 +1092,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.First_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, TSource>(First).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("First`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource First<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1207,13 +1105,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.First_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource>(First).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("FirstOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? FirstOrDefault<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1221,7 +1117,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.FirstOrDefault_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, TSource?>(FirstOrDefault).Method,
+                    source.Expression));
         }
 
         /// <summary>Returns the first element of a sequence, or a default value if the sequence contains no elements.</summary>
@@ -1231,7 +1128,6 @@ namespace System.Linq
         /// <returns><paramref name="defaultValue" /> if <paramref name="source" /> is empty; otherwise, the first element in <paramref name="source" />.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         [DynamicDependency("FirstOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource FirstOrDefault<TSource>(this IQueryable<TSource> source, TSource defaultValue)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1239,12 +1135,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.FirstOrDefault_TSource_3(typeof(TSource)),
+                    new Func<IQueryable<TSource>, TSource, TSource>(FirstOrDefault).Method,
                     source.Expression, Expression.Constant(defaultValue, typeof(TSource))));
         }
 
         [DynamicDependency("FirstOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? FirstOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1253,9 +1148,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.FirstOrDefault_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource?>(FirstOrDefault).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         /// <summary>Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.</summary>
@@ -1266,7 +1160,6 @@ namespace System.Linq
         /// <returns><paramref name="defaultValue" /> if <paramref name="source" /> is empty or if no element passes the test specified by <paramref name="predicate" />; otherwise, the first element in <paramref name="source" /> that passes the test specified by <paramref name="predicate" />.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source" /> or <paramref name="predicate" /> is <see langword="null" />.</exception>
         [DynamicDependency("FirstOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource FirstOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, TSource defaultValue)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1275,13 +1168,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.FirstOrDefault_TSource_4(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate), Expression.Constant(defaultValue, typeof(TSource))
-                ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource, TSource>(FirstOrDefault).Method,
+                    source.Expression, Expression.Quote(predicate), Expression.Constant(defaultValue, typeof(TSource))));
         }
 
         [DynamicDependency("Last`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource Last<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1289,11 +1180,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Last_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, TSource>(Last).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Last`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource Last<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1302,13 +1193,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Last_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource>(Last).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("LastOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? LastOrDefault<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1316,7 +1205,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.LastOrDefault_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, TSource?>(LastOrDefault).Method,
+                    source.Expression));
         }
 
         /// <summary>Returns the last element of a sequence, or a default value if the sequence contains no elements.</summary>
@@ -1326,7 +1216,6 @@ namespace System.Linq
         /// <returns><paramref name="defaultValue" /> if the source sequence is empty; otherwise, the last element in the <see cref="IEnumerable{T}" />.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         [DynamicDependency("LastOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource LastOrDefault<TSource>(this IQueryable<TSource> source, TSource defaultValue)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1334,12 +1223,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.LastOrDefault_TSource_3(typeof(TSource)),
+                    new Func<IQueryable<TSource>, TSource, TSource>(LastOrDefault).Method,
                     source.Expression, Expression.Constant(defaultValue, typeof(TSource))));
         }
 
         [DynamicDependency("LastOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? LastOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1348,9 +1236,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.LastOrDefault_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource?>(LastOrDefault).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         /// <summary>Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.</summary>
@@ -1361,7 +1248,6 @@ namespace System.Linq
         /// <returns><paramref name="defaultValue" /> if the sequence is empty or if no elements pass the test in the predicate function; otherwise, the last element that passes the test in the predicate function.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source" /> or <paramref name="predicate" /> is <see langword="null" />.</exception>
         [DynamicDependency("LastOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource LastOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, TSource defaultValue)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1370,13 +1256,12 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.LastOrDefault_TSource_4(typeof(TSource)),
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource, TSource>(LastOrDefault).Method,
                     source.Expression, Expression.Quote(predicate), Expression.Constant(defaultValue, typeof(TSource))
                 ));
         }
 
         [DynamicDependency("Single`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource Single<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1384,11 +1269,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Single_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, TSource>(Single).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Single`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource Single<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1397,13 +1282,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Single_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource>(Single).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("SingleOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? SingleOrDefault<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1411,7 +1294,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SingleOrDefault_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, TSource?>(SingleOrDefault).Method,
+                    source.Expression));
         }
 
         /// <summary>Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.</summary>
@@ -1422,7 +1306,6 @@ namespace System.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         /// <exception cref="InvalidOperationException">The input sequence contains more than one element.</exception>
         [DynamicDependency("SingleOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource SingleOrDefault<TSource>(this IQueryable<TSource> source, TSource defaultValue)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1430,12 +1313,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SingleOrDefault_TSource_3(typeof(TSource)),
+                    new Func<IQueryable<TSource>, TSource, TSource>(SingleOrDefault).Method,
                     source.Expression, Expression.Constant(defaultValue, typeof(TSource))));
         }
 
         [DynamicDependency("SingleOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? SingleOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1444,9 +1326,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SingleOrDefault_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource?>(SingleOrDefault).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         /// <summary>Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.</summary>
@@ -1458,7 +1339,6 @@ namespace System.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source" /> or <paramref name="predicate" /> is <see langword="null" />.</exception>
         /// <exception cref="InvalidOperationException">More than one element satisfies the condition in <paramref name="predicate" />.</exception>
         [DynamicDependency("SingleOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource SingleOrDefault<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, TSource defaultValue)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1467,13 +1347,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SingleOrDefault_TSource_4(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate), Expression.Constant(defaultValue, typeof(TSource))
-                ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, TSource, TSource>(SingleOrDefault).Method,
+                    source.Expression, Expression.Quote(predicate), Expression.Constant(defaultValue, typeof(TSource))));
         }
 
         [DynamicDependency("ElementAt`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource ElementAt<TSource>(this IQueryable<TSource> source, int index)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1484,9 +1362,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ElementAt_Int32_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(index)
-                    ));
+                    new Func<IQueryable<TSource>, int, TSource>(ElementAt).Method,
+                    source.Expression, Expression.Constant(index)));
         }
 
         /// <summary>Returns the element at a specified index in a sequence.</summary>
@@ -1497,7 +1374,6 @@ namespace System.Linq
         /// <exception cref="ArgumentOutOfRangeException"><paramref name="index" /> is outside the bounds of the <paramref name="source" /> sequence.</exception>
         /// <returns>The element at the specified position in the <paramref name="source" /> sequence.</returns>
         [DynamicDependency("ElementAt`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource ElementAt<TSource>(this IQueryable<TSource> source, Index index)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1508,13 +1384,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ElementAt_Index_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(index)
-                    ));
+                    new Func<IQueryable<TSource>, Index, TSource>(ElementAt).Method,
+                    source.Expression, Expression.Constant(index)));
         }
 
         [DynamicDependency("ElementAtOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? ElementAtOrDefault<TSource>(this IQueryable<TSource> source, int index)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1522,9 +1396,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ElementAtOrDefault_Int32_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(index)
-                    ));
+                    new Func<IQueryable<TSource>, int, TSource?>(ElementAtOrDefault).Method,
+                    source.Expression, Expression.Constant(index)));
         }
 
         /// <summary>Returns the element at a specified index in a sequence or a default value if the index is out of range.</summary>
@@ -1534,7 +1407,6 @@ namespace System.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         /// <returns><see langword="default" /> if <paramref name="index" /> is outside the bounds of the <paramref name="source" /> sequence; otherwise, the element at the specified position in the <paramref name="source" /> sequence.</returns>
         [DynamicDependency("ElementAtOrDefault`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? ElementAtOrDefault<TSource>(this IQueryable<TSource> source, Index index)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1542,13 +1414,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.ElementAtOrDefault_Index_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(index)
-                    ));
+                    new Func<IQueryable<TSource>, Index, TSource?>(ElementAtOrDefault).Method,
+                    source.Expression, Expression.Constant(index)));
         }
 
         [DynamicDependency("DefaultIfEmpty`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource?> DefaultIfEmpty<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1556,11 +1426,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.DefaultIfEmpty_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, IQueryable<TSource?>>(DefaultIfEmpty).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("DefaultIfEmpty`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> DefaultIfEmpty<TSource>(this IQueryable<TSource> source, TSource defaultValue)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1568,13 +1438,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.DefaultIfEmpty_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(defaultValue, typeof(TSource))
-                    ));
+                    new Func<IQueryable<TSource>, TSource, IQueryable<TSource?>>(DefaultIfEmpty).Method,
+                    source.Expression, Expression.Constant(defaultValue, typeof(TSource))));
         }
 
         [DynamicDependency("Contains`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static bool Contains<TSource>(this IQueryable<TSource> source, TSource item)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1582,13 +1450,11 @@ namespace System.Linq
             return source.Provider.Execute<bool>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Contains_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(item, typeof(TSource))
-                    ));
+                    new Func<IQueryable<TSource>, TSource, bool>(Contains).Method,
+                    source.Expression, Expression.Constant(item, typeof(TSource))));
         }
 
         [DynamicDependency("Contains`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static bool Contains<TSource>(this IQueryable<TSource> source, TSource item, IEqualityComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1596,13 +1462,11 @@ namespace System.Linq
             return source.Provider.Execute<bool>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Contains_TSource_3(typeof(TSource)),
-                    source.Expression, Expression.Constant(item, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))
-                    ));
+                    new Func<IQueryable<TSource>, TSource, IEqualityComparer<TSource>, bool>(Contains).Method,
+                    source.Expression, Expression.Constant(item, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
         }
 
         [DynamicDependency("Reverse`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Reverse<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1610,11 +1474,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Reverse_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, IQueryable<TSource>>(Reverse).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("SequenceEqual`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static bool SequenceEqual<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1623,13 +1487,11 @@ namespace System.Linq
             return source1.Provider.Execute<bool>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SequenceEqual_TSource_2(typeof(TSource)),
-                    source1.Expression, GetSourceExpression(source2)
-                    ));
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, bool>(SequenceEqual).Method,
+                    source1.Expression, GetSourceExpression(source2)));
         }
 
         [DynamicDependency("SequenceEqual`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static bool SequenceEqual<TSource>(this IQueryable<TSource> source1, IEnumerable<TSource> source2, IEqualityComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source1);
@@ -1638,15 +1500,13 @@ namespace System.Linq
             return source1.Provider.Execute<bool>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SequenceEqual_TSource_3(typeof(TSource)),
+                    new Func<IQueryable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>, bool>(SequenceEqual).Method,
                     source1.Expression,
                     GetSourceExpression(source2),
-                    Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))
-                    ));
+                    Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
         }
 
         [DynamicDependency("Any`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static bool Any<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1654,11 +1514,11 @@ namespace System.Linq
             return source.Provider.Execute<bool>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Any_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, bool>(Any).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Any`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static bool Any<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1667,13 +1527,11 @@ namespace System.Linq
             return source.Provider.Execute<bool>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Any_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, bool>(Any).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("All`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static bool All<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1682,13 +1540,11 @@ namespace System.Linq
             return source.Provider.Execute<bool>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.All_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, bool>(All).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("Count`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static int Count<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1696,11 +1552,11 @@ namespace System.Linq
             return source.Provider.Execute<int>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Count_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, int>(Count).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Count`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static int Count<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1709,13 +1565,11 @@ namespace System.Linq
             return source.Provider.Execute<int>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Count_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, int>(Count).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("LongCount`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static long LongCount<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1723,11 +1577,11 @@ namespace System.Linq
             return source.Provider.Execute<long>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.LongCount_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, long>(LongCount).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("LongCount`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static long LongCount<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1736,13 +1590,11 @@ namespace System.Linq
             return source.Provider.Execute<long>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.LongCount_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(predicate)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, bool>>, long>(LongCount).Method,
+                    source.Expression, Expression.Quote(predicate)));
         }
 
         [DynamicDependency("Min`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? Min<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1750,7 +1602,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Min_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, TSource?>(Min).Method,
+                    source.Expression));
         }
 
         /// <summary>Returns the minimum value in a generic <see cref="System.Linq.IQueryable{T}" />.</summary>
@@ -1761,7 +1614,6 @@ namespace System.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">No object in <paramref name="source" /> implements the <see cref="System.IComparable" /> or <see cref="System.IComparable{T}" /> interface.</exception>
         [DynamicDependency("Min`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? Min<TSource>(this IQueryable<TSource> source, IComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1769,14 +1621,12 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Min_TSource_2(typeof(TSource)),
+                    new Func<IQueryable<TSource>, IComparer<TSource>, TSource?>(Min).Method,
                     source.Expression,
-                    Expression.Constant(comparer, typeof(IComparer<TSource>))
-                    ));
+                    Expression.Constant(comparer, typeof(IComparer<TSource>))));
         }
 
         [DynamicDependency("Min`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TResult? Min<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1785,9 +1635,8 @@ namespace System.Linq
             return source.Provider.Execute<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Min_TSource_TResult_2(typeof(TSource), typeof(TResult)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TResult>>, TResult?>(Min).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         /// <summary>Returns the minimum value in a generic <see cref="IQueryable{T}"/> according to a specified key selector function.</summary>
@@ -1799,7 +1648,6 @@ namespace System.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">No key extracted from <paramref name="source" /> implements the <see cref="IComparable" /> or <see cref="IComparable{TKey}" /> interface.</exception>
         [DynamicDependency("MinBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? MinBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1808,10 +1656,9 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.MinBy_TSource_TKey_2(typeof(TSource), typeof(TKey)),
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, TSource?>(MinBy).Method,
                     source.Expression,
-                    Expression.Quote(keySelector)
-                    ));
+                    Expression.Quote(keySelector)));
         }
 
         /// <summary>Returns the minimum value in a generic <see cref="IQueryable{T}"/> according to a specified key selector function.</summary>
@@ -1824,7 +1671,6 @@ namespace System.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">No key extracted from <paramref name="source" /> implements the <see cref="IComparable" /> or <see cref="IComparable{TKey}" /> interface.</exception>
         [DynamicDependency("MinBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? MinBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1833,15 +1679,13 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.MinBy_TSource_TKey_3(typeof(TSource), typeof(TKey)),
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TSource>, TSource?>(MinBy).Method,
                     source.Expression,
                     Expression.Quote(keySelector),
-                    Expression.Constant(comparer, typeof(IComparer<TSource>))
-                    ));
+                    Expression.Constant(comparer, typeof(IComparer<TSource>))));
         }
 
         [DynamicDependency("Max`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? Max<TSource>(this IQueryable<TSource> source)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1849,7 +1693,8 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Max_TSource_1(typeof(TSource)), source.Expression));
+                    new Func<IQueryable<TSource>, TSource?>(Max).Method,
+                    source.Expression));
         }
 
         /// <summary>Returns the maximum value in a generic <see cref="System.Linq.IQueryable{T}" />.</summary>
@@ -1859,7 +1704,6 @@ namespace System.Linq
         /// <returns>The maximum value in the sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         [DynamicDependency("Max`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? Max<TSource>(this IQueryable<TSource> source, IComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1867,14 +1711,12 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Max_TSource_2(typeof(TSource)),
+                    new Func<IQueryable<TSource>, IComparer<TSource>, TSource?>(Max).Method,
                     source.Expression,
-                    Expression.Constant(comparer, typeof(IComparer<TSource>))
-                    ));
+                    Expression.Constant(comparer, typeof(IComparer<TSource>))));
         }
 
         [DynamicDependency("Max`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TResult? Max<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1883,9 +1725,8 @@ namespace System.Linq
             return source.Provider.Execute<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Max_TSource_TResult_2(typeof(TSource), typeof(TResult)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TResult>>, TResult?>(Max).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         /// <summary>Returns the maximum value in a generic <see cref="IQueryable{T}"/> according to a specified key selector function.</summary>
@@ -1897,7 +1738,6 @@ namespace System.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">No key extracted from <paramref name="source" /> implements the <see cref="IComparable" /> or <see cref="IComparable{TKey}" /> interface.</exception>
         [DynamicDependency("MaxBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? MaxBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1906,10 +1746,9 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.MaxBy_TSource_TKey_2(typeof(TSource), typeof(TKey)),
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, TSource?>(MaxBy).Method,
                     source.Expression,
-                    Expression.Quote(keySelector)
-                    ));
+                    Expression.Quote(keySelector)));
         }
 
         /// <summary>Returns the maximum value in a generic <see cref="IQueryable{T}"/> according to a specified key selector function.</summary>
@@ -1922,7 +1761,6 @@ namespace System.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source" /> is <see langword="null" />.</exception>
         /// <exception cref="ArgumentException">No key extracted from <paramref name="source" /> implements the <see cref="IComparable" /> or <see cref="IComparable{TKey}" /> interface.</exception>
         [DynamicDependency("MaxBy`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource? MaxBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TSource>? comparer)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -1931,11 +1769,10 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.MaxBy_TSource_TKey_3(typeof(TSource), typeof(TKey)),
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TSource>, TSource?>(MaxBy).Method,
                     source.Expression,
                     Expression.Quote(keySelector),
-                    Expression.Constant(comparer, typeof(IComparer<TSource>))
-                    ));
+                    Expression.Constant(comparer, typeof(IComparer<TSource>))));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -1946,7 +1783,8 @@ namespace System.Linq
             return source.Provider.Execute<int>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Int32_1, source.Expression));
+                    new Func<IQueryable<int>, int>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -1957,7 +1795,8 @@ namespace System.Linq
             return source.Provider.Execute<int?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableInt32_1, source.Expression));
+                    new Func<IQueryable<int?>, int?>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -1968,7 +1807,8 @@ namespace System.Linq
             return source.Provider.Execute<long>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Int64_1, source.Expression));
+                    new Func<IQueryable<long>, long>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -1979,7 +1819,8 @@ namespace System.Linq
             return source.Provider.Execute<long?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableInt64_1, source.Expression));
+                    new Func<IQueryable<long?>, long?>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -1990,7 +1831,8 @@ namespace System.Linq
             return source.Provider.Execute<float>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Single_1, source.Expression));
+                    new Func<IQueryable<float>, float>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -2001,7 +1843,8 @@ namespace System.Linq
             return source.Provider.Execute<float?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableSingle_1, source.Expression));
+                    new Func<IQueryable<float?>, float?>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -2012,7 +1855,8 @@ namespace System.Linq
             return source.Provider.Execute<double>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Double_1, source.Expression));
+                    new Func<IQueryable<double>, double>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -2023,7 +1867,8 @@ namespace System.Linq
             return source.Provider.Execute<double?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableDouble_1, source.Expression));
+                    new Func<IQueryable<double?>, double?>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -2034,7 +1879,8 @@ namespace System.Linq
             return source.Provider.Execute<decimal>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Decimal_1, source.Expression));
+                    new Func<IQueryable<decimal>, decimal>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum", typeof(Enumerable))]
@@ -2045,11 +1891,11 @@ namespace System.Linq
             return source.Provider.Execute<decimal?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableDecimal_1, source.Expression));
+                    new Func<IQueryable<decimal?>, decimal?>(Sum).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static int Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2058,13 +1904,11 @@ namespace System.Linq
             return source.Provider.Execute<int>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Int32_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int>>, int>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static int? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2073,13 +1917,11 @@ namespace System.Linq
             return source.Provider.Execute<int?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableInt32_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int?>>, int?>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static long Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2088,13 +1930,11 @@ namespace System.Linq
             return source.Provider.Execute<long>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Int64_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, long>>, long>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static long? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2103,13 +1943,11 @@ namespace System.Linq
             return source.Provider.Execute<long?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableInt64_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, long?>>, long?>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static float Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2118,13 +1956,11 @@ namespace System.Linq
             return source.Provider.Execute<float>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Single_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, float>>, float>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static float? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2133,13 +1969,11 @@ namespace System.Linq
             return source.Provider.Execute<float?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableSingle_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, float?>>, float?>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static double Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2148,13 +1982,11 @@ namespace System.Linq
             return source.Provider.Execute<double>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Double_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, double>>, double>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static double? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2163,13 +1995,11 @@ namespace System.Linq
             return source.Provider.Execute<double?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableDouble_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, double?>>, double?>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static decimal Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2178,13 +2008,11 @@ namespace System.Linq
             return source.Provider.Execute<decimal>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_Decimal_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, decimal>>, decimal>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Sum`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static decimal? Sum<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2193,9 +2021,8 @@ namespace System.Linq
             return source.Provider.Execute<decimal?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Sum_NullableDecimal_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, decimal?>>, decimal?>(Sum).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2206,7 +2033,8 @@ namespace System.Linq
             return source.Provider.Execute<double>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Int32_1, source.Expression));
+                    new Func<IQueryable<int>, double>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2217,7 +2045,8 @@ namespace System.Linq
             return source.Provider.Execute<double?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableInt32_1, source.Expression));
+                    new Func<IQueryable<int?>, double?>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2228,7 +2057,8 @@ namespace System.Linq
             return source.Provider.Execute<double>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Int64_1, source.Expression));
+                    new Func<IQueryable<long>, double>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2239,7 +2069,8 @@ namespace System.Linq
             return source.Provider.Execute<double?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableInt64_1, source.Expression));
+                    new Func<IQueryable<long?>, double?>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2250,7 +2081,8 @@ namespace System.Linq
             return source.Provider.Execute<float>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Single_1, source.Expression));
+                    new Func<IQueryable<float>, float>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2261,7 +2093,8 @@ namespace System.Linq
             return source.Provider.Execute<float?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableSingle_1, source.Expression));
+                    new Func<IQueryable<float?>, float?>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2272,7 +2105,8 @@ namespace System.Linq
             return source.Provider.Execute<double>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Double_1, source.Expression));
+                    new Func<IQueryable<double>, double>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2283,7 +2117,8 @@ namespace System.Linq
             return source.Provider.Execute<double?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableDouble_1, source.Expression));
+                    new Func<IQueryable<double?>, double?>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2294,7 +2129,8 @@ namespace System.Linq
             return source.Provider.Execute<decimal>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Decimal_1, source.Expression));
+                    new Func<IQueryable<decimal>, decimal>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average", typeof(Enumerable))]
@@ -2305,11 +2141,11 @@ namespace System.Linq
             return source.Provider.Execute<decimal?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableDecimal_1, source.Expression));
+                    new Func<IQueryable<decimal?>, decimal?>(Average).Method,
+                    source.Expression));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static double Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2318,13 +2154,11 @@ namespace System.Linq
             return source.Provider.Execute<double>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Int32_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int>>, double>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static double? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2333,13 +2167,11 @@ namespace System.Linq
             return source.Provider.Execute<double?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableInt32_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, int?>>, double?>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static float Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2348,13 +2180,11 @@ namespace System.Linq
             return source.Provider.Execute<float>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Single_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, float>>, float>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static float? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2363,13 +2193,11 @@ namespace System.Linq
             return source.Provider.Execute<float?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableSingle_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, float?>>, float?>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static double Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2378,13 +2206,11 @@ namespace System.Linq
             return source.Provider.Execute<double>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Int64_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, long>>, double>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static double? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2393,13 +2219,11 @@ namespace System.Linq
             return source.Provider.Execute<double?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableInt64_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, long?>>, double?>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static double Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2408,13 +2232,11 @@ namespace System.Linq
             return source.Provider.Execute<double>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Double_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, double>>, double>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static double? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2423,13 +2245,11 @@ namespace System.Linq
             return source.Provider.Execute<double?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableDouble_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, double?>>, double?>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static decimal Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2438,13 +2258,11 @@ namespace System.Linq
             return source.Provider.Execute<decimal>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_Decimal_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, decimal>>, decimal>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Average`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static decimal? Average<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2453,13 +2271,11 @@ namespace System.Linq
             return source.Provider.Execute<decimal?>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Average_NullableDecimal_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(selector)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, decimal?>>, decimal?>(Average).Method,
+                    source.Expression, Expression.Quote(selector)));
         }
 
         [DynamicDependency("Aggregate`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TSource Aggregate<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, TSource, TSource>> func)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2468,13 +2284,11 @@ namespace System.Linq
             return source.Provider.Execute<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Aggregate_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Quote(func)
-                    ));
+                    new Func<IQueryable<TSource>, Expression<Func<TSource, TSource, TSource>>, TSource>(Aggregate).Method,
+                    source.Expression, Expression.Quote(func)));
         }
 
         [DynamicDependency("Aggregate`2", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TAccumulate Aggregate<TSource, TAccumulate>(this IQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> func)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2483,13 +2297,11 @@ namespace System.Linq
             return source.Provider.Execute<TAccumulate>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Aggregate_TSource_TAccumulate_3(typeof(TSource), typeof(TAccumulate)),
-                    source.Expression, Expression.Constant(seed), Expression.Quote(func)
-                    ));
+                    new Func<IQueryable<TSource>, TAccumulate, Expression<Func<TAccumulate, TSource, TAccumulate>>, TAccumulate>(Aggregate).Method,
+                    source.Expression, Expression.Constant(seed), Expression.Quote(func)));
         }
 
         [DynamicDependency("Aggregate`3", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static TResult Aggregate<TSource, TAccumulate, TResult>(this IQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> func, Expression<Func<TAccumulate, TResult>> selector)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2499,11 +2311,11 @@ namespace System.Linq
             return source.Provider.Execute<TResult>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Aggregate_TSource_TAccumulate_TResult_4(typeof(TSource), typeof(TAccumulate), typeof(TResult)), source.Expression, Expression.Constant(seed), Expression.Quote(func), Expression.Quote(selector)));
+                    new Func<IQueryable<TSource>, TAccumulate, Expression<Func<TAccumulate, TSource, TAccumulate>>, Expression<Func<TAccumulate, TResult>>, TResult>(Aggregate).Method,
+                    source.Expression, Expression.Constant(seed), Expression.Quote(func), Expression.Quote(selector)));
         }
 
         [DynamicDependency("SkipLast`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> SkipLast<TSource>(this IQueryable<TSource> source, int count)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2511,13 +2323,12 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.SkipLast_TSource_2(typeof(TSource)),
+                    new Func<IQueryable<TSource>, int, IQueryable<TSource>>(SkipLast).Method,
                     source.Expression, Expression.Constant(count)
                     ));
         }
 
         [DynamicDependency("TakeLast`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> TakeLast<TSource>(this IQueryable<TSource> source, int count)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2525,13 +2336,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.TakeLast_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(count)
-                    ));
+                    new Func<IQueryable<TSource>, int, IQueryable<TSource>>(TakeLast).Method,
+                    source.Expression, Expression.Constant(count)));
         }
 
         [DynamicDependency("Append`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Append<TSource>(this IQueryable<TSource> source, TSource element)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2539,13 +2348,11 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Append_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(element)
-                    ));
+                    new Func<IQueryable<TSource>, TSource, IQueryable<TSource>>(Append).Method,
+                    source.Expression, Expression.Constant(element)));
         }
 
         [DynamicDependency("Prepend`1", typeof(Enumerable))]
-        [RequiresDynamicCode(InMemoryQueryableExtensionMethodsRequiresDynamicCode)]
         public static IQueryable<TSource> Prepend<TSource>(this IQueryable<TSource> source, TSource element)
         {
             ArgumentNullException.ThrowIfNull(source);
@@ -2553,9 +2360,8 @@ namespace System.Linq
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
                     null,
-                    CachedReflectionInfo.Prepend_TSource_2(typeof(TSource)),
-                    source.Expression, Expression.Constant(element)
-                    ));
+                    new Func<IQueryable<TSource>, TSource, IQueryable<TSource>>(Prepend).Method,
+                    source.Expression, Expression.Constant(element)));
         }
     }
 }
index 86e2ac8..59885eb 100644 (file)
@@ -64,21 +64,21 @@ namespace System.Linq.Tests
         [Fact]
         public void Aggregate1()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Aggregate((n1, n2) => n1 + n2);
+            var val = new[] { 0, 2, 1 }.AsQueryable().Aggregate((n1, n2) => n1 + n2);
             Assert.Equal((int)3, val);
         }
 
         [Fact]
         public void Aggregate2()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Aggregate("", (n1, n2) => n1 + n2.ToString());
+            var val = new[] { 0, 2, 1 }.AsQueryable().Aggregate("", (n1, n2) => n1 + n2.ToString());
             Assert.Equal("021", val);
         }
 
         [Fact]
         public void Aggregate3()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Aggregate(0L, (n1, n2) => n1 + n2, n => n.ToString());
+            var val = new[] { 0, 2, 1 }.AsQueryable().Aggregate(0L, (n1, n2) => n1 + n2, n => n.ToString());
             Assert.Equal("3", val);
         }
     }
index 137142d..a990242 100644 (file)
@@ -32,7 +32,7 @@ namespace System.Linq.Tests
         [Fact]
         public void All()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().All(n => n > 1);
+            var val = new[] { 0, 2, 1 }.AsQueryable().All(n => n > 1);
             Assert.False(val);
         }
     }
index e218d53..3d75555 100644 (file)
@@ -55,14 +55,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Any1()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Any();
+            var val = new[] { 0, 2, 1 }.AsQueryable().Any();
             Assert.True(val);
         }
 
         [Fact]
         public void Any2()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Any(n => n > 1);
+            var val = new[] { 0, 2, 1 }.AsQueryable().Any(n => n > 1);
             Assert.True(val);
         }
     }
index 668e4c9..39055e4 100644 (file)
@@ -432,140 +432,140 @@ namespace System.Linq.Tests
         [Fact]
         public void Average1()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average2()
         {
-            var val = (new int?[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new int?[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average3()
         {
-            var val = (new long[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new long[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average4()
         {
-            var val = (new long?[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new long?[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average5()
         {
-            var val = (new float[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new float[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((float)1, val);
         }
 
         [Fact]
         public void Average6()
         {
-            var val = (new float?[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new float?[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((float)1, val);
         }
 
         [Fact]
         public void Average7()
         {
-            var val = (new double[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new double[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average8()
         {
-            var val = (new double?[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new double?[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average9()
         {
-            var val = (new decimal[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new decimal[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((decimal)1, val);
         }
 
         [Fact]
         public void Average10()
         {
-            var val = (new decimal?[] { 0, 2, 1 }).AsQueryable().Average();
+            var val = new decimal?[] { 0, 2, 1 }.AsQueryable().Average();
             Assert.Equal((decimal)1, val);
         }
 
         [Fact]
         public void Average11()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average12()
         {
-            var val = (new int?[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new int?[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average13()
         {
-            var val = (new long[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new long[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average14()
         {
-            var val = (new long?[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new long?[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average15()
         {
-            var val = (new float[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new float[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((float)1, val);
         }
 
         [Fact]
         public void Average16()
         {
-            var val = (new float?[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new float?[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((float)1, val);
         }
 
         [Fact]
         public void Average17()
         {
-            var val = (new double[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new double[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average18()
         {
-            var val = (new double?[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new double?[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((double)1, val);
         }
 
         [Fact]
         public void Average19()
         {
-            var val = (new decimal[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new decimal[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((decimal)1, val);
         }
 
         [Fact]
         public void Average20()
         {
-            var val = (new decimal?[] { 0, 2, 1 }).AsQueryable().Average(n => n);
+            var val = new decimal?[] { 0, 2, 1 }.AsQueryable().Average(n => n);
             Assert.Equal((decimal)1, val);
         }
     }
index de500ec..52539d0 100644 (file)
@@ -92,7 +92,7 @@ namespace System.Linq.Tests
         [Fact]
         public void ThrowCastingIntToDouble()
         {
-            int[] source = new int[] { -4, 1, 2, 9 };
+            int[] source = { -4, 1, 2, 9 };
 
             IQueryable<double> cast = source.AsQueryable().Cast<double>();
             Assert.Throws<InvalidCastException>(() => cast.ToList());
@@ -159,7 +159,7 @@ namespace System.Linq.Tests
         [Fact]
         public void ThrowCastingIntToLong()
         {
-            int[] source = new int[] { -4, 1, 2, 3, 9 };
+            int[] source = { -4, 1, 2, 3, 9 };
 
             IQueryable<long> cast = source.AsQueryable().Cast<long>();
             Assert.Throws<InvalidCastException>(() => cast.ToList());
@@ -168,7 +168,7 @@ namespace System.Linq.Tests
         [Fact]
         public void ThrowCastingIntToNullableLong()
         {
-            int[] source = new int[] { -4, 1, 2, 3, 9 };
+            int[] source = { -4, 1, 2, 3, 9 };
 
             IQueryable<long?> cast = source.AsQueryable().Cast<long?>();
             Assert.Throws<InvalidCastException>(() => cast.ToList());
@@ -177,7 +177,7 @@ namespace System.Linq.Tests
         [Fact]
         public void ThrowCastingNullableIntToLong()
         {
-            int?[] source = new int?[] { -4, 1, 2, 3, 9 };
+            int?[] source = { -4, 1, 2, 3, 9 };
 
             IQueryable<long> cast = source.AsQueryable().Cast<long>();
             Assert.Throws<InvalidCastException>(() => cast.ToList());
@@ -186,7 +186,7 @@ namespace System.Linq.Tests
         [Fact]
         public void ThrowCastingNullableIntToNullableLong()
         {
-            int?[] source = new int?[] { -4, 1, 2, 3, 9, null };
+            int?[] source = { -4, 1, 2, 3, 9, null };
 
             IQueryable<long?> cast = source.AsQueryable().Cast<long?>();
             Assert.Throws<InvalidCastException>(() => cast.ToList());
@@ -195,7 +195,7 @@ namespace System.Linq.Tests
         [Fact]
         public void CastingNullToNonnullableIsNullReferenceException()
         {
-            int?[] source = new int?[] { -4, 1, null, 3 };
+            int?[] source = { -4, 1, null, 3 };
             IQueryable<int> cast = source.AsQueryable().Cast<int>();
             Assert.Throws<NullReferenceException>(() => cast.ToList());
         }
@@ -209,7 +209,7 @@ namespace System.Linq.Tests
         [Fact]
         public void Cast()
         {
-            var count = (new object[] { 0, 1, 2 }).AsQueryable().Cast<int>().Count();
+            var count = new object[] { 0, 1, 2 }.AsQueryable().Cast<int>().Count();
             Assert.Equal(3, count);
         }
     }
index 90cb45f..d04195a 100644 (file)
@@ -40,7 +40,7 @@ namespace System.Linq.Tests
         [Fact]
         public void Concat()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Concat((new int[] { 10, 11, 12 }).AsQueryable()).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Concat(new[] { 10, 11, 12 }.AsQueryable()).Count();
             Assert.Equal(6, count);
         }
     }
index b1f2561..9581b8e 100644 (file)
@@ -62,14 +62,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Contains1()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Contains(1);
+            var val = new[] { 0, 2, 1 }.AsQueryable().Contains(1);
             Assert.True(val);
         }
 
         [Fact]
         public void Contains2()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Contains(1, EqualityComparer<int>.Default);
+            var val = new[] { 0, 2, 1 }.AsQueryable().Contains(1, EqualityComparer<int>.Default);
             Assert.True(val);
         }
     }
index 9d564a6..5123ec6 100644 (file)
@@ -56,14 +56,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Count1()
         {
-            var count = (new int[] { 0 }).AsQueryable().Count();
+            var count = new[] { 0 }.AsQueryable().Count();
             Assert.Equal(1, count);
         }
 
         [Fact]
         public void Count2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Count(n => n > 0);
+            var count = new[] { 0, 1, 2 }.AsQueryable().Count(n => n > 0);
             Assert.Equal(2, count);
         }
     }
index 30c79f2..aa6f269 100644 (file)
@@ -65,14 +65,14 @@ namespace System.Linq.Tests
         [Fact]
         public void DefaultIfEmpty1()
         {
-            var count = (new int[] { }).AsQueryable().DefaultIfEmpty().Count();
+            var count = new int[] { }.AsQueryable().DefaultIfEmpty().Count();
             Assert.Equal(1, count);
         }
 
         [Fact]
         public void DefaultIfEmpty2()
         {
-            var count = (new int[] { }).AsQueryable().DefaultIfEmpty(3).Count();
+            var count = new int[] { }.AsQueryable().DefaultIfEmpty(3).Count();
             Assert.Equal(1, count);
         }
 
index 4445690..fa8a0b1 100644 (file)
@@ -68,14 +68,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Distinct1()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().Distinct().Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().Distinct().Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void Distinct2()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().Distinct(EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().Distinct(EqualityComparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
 
index 8a02695..60d5026 100644 (file)
@@ -39,7 +39,7 @@ namespace System.Linq.Tests
         public void WrapsEnumerableInExpression()
         {
             int[] source = { 1, 2, 3 };
-            IQueryable<int> query = (source).AsQueryable();
+            IQueryable<int> query = source.AsQueryable();
             var exp = (ConstantExpression)query.Expression;
             Assert.Equal(source, (IEnumerable<int>)exp.Value);
         }
index 7ccd478..80ce55f 100644 (file)
@@ -76,14 +76,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Except1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Except((new int[] { 1, 2, 3 }).AsQueryable()).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Except(new[] { 1, 2, 3 }.AsQueryable()).Count();
             Assert.Equal(1, count);
         }
 
         [Fact]
         public void Except2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Except((new int[] { 1, 2, 3 }).AsQueryable(), EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Except(new[] { 1, 2, 3 }.AsQueryable(), EqualityComparer<int>.Default).Count();
             Assert.Equal(1, count);
         }
 
index 9d65517..d98c27a 100644 (file)
@@ -119,14 +119,14 @@ namespace System.Linq.Tests
         [Fact]
         public void FirstOrDefault1()
         {
-            var val = (new int[] { 1, 2 }).AsQueryable().FirstOrDefault();
+            var val = new[] { 1, 2 }.AsQueryable().FirstOrDefault();
             Assert.Equal(1, val);
         }
 
         [Fact]
         public void FirstOrDefault2()
         {
-            var val = (new int[] { 0, 1, 2 }).AsQueryable().FirstOrDefault(n => n > 1);
+            var val = new[] { 0, 1, 2 }.AsQueryable().FirstOrDefault(n => n > 1);
             Assert.Equal(2, val);
         }
 
index 906c87f..6996329 100644 (file)
@@ -72,14 +72,14 @@ namespace System.Linq.Tests
         [Fact]
         public void First1()
         {
-            var val = (new int[] { 1, 2 }).AsQueryable().First();
+            var val = new[] { 1, 2 }.AsQueryable().First();
             Assert.Equal(1, val);
         }
 
         [Fact]
         public void First2()
         {
-            var val = (new int[] { 0, 1, 2 }).AsQueryable().First(n => n > 1);
+            var val = new[] { 0, 1, 2 }.AsQueryable().First(n => n > 1);
             Assert.Equal(2, val);
         }
     }
index 004b2d6..24f90a3 100644 (file)
@@ -111,8 +111,7 @@ namespace System.Linq.Tests
         [Fact]
         public void KeySelectorNull()
         {
-            Record[] source = new[]
-            {
+            Record[] source = {
                 new Record { Name = "Tim", Score = 55 },
                 new Record { Name = "Chris", Score = 49 },
                 new Record { Name = "Robert", Score = -100 },
@@ -136,8 +135,7 @@ namespace System.Linq.Tests
         [Fact]
         public void ElementSelectorNull()
         {
-            Record[] source = new[]
-            {
+            Record[] source = {
                 new Record { Name = "Tim", Score = 55 },
                 new Record { Name = "Chris", Score = 49 },
                 new Record { Name = "Robert", Score = -100 },
@@ -313,56 +311,56 @@ namespace System.Linq.Tests
         [Fact]
         public void GroupBy1()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().GroupBy(n => n).Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().GroupBy(n => n).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void GroupBy2()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().GroupBy(n => n, EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().GroupBy(n => n, EqualityComparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void GroupBy3()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().GroupBy(n => n, n => n).Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().GroupBy(n => n, n => n).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void GroupBy4()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().GroupBy(n => n, n => n, EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().GroupBy(n => n, n => n, EqualityComparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void GroupBy5()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().GroupBy(n => n, n => n, (k, g) => k).Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().GroupBy(n => n, n => n, (k, g) => k).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void GroupBy6()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().GroupBy(n => n, (k, g) => k).Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().GroupBy(n => n, (k, g) => k).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void GroupBy7()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().GroupBy(n => n, n => n, (k, g) => k, EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().GroupBy(n => n, n => n, (k, g) => k, EqualityComparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void GroupBy8()
         {
-            var count = (new int[] { 0, 1, 2, 2, 0 }).AsQueryable().GroupBy(n => n, (k, g) => k, EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2, 2, 0 }.AsQueryable().GroupBy(n => n, (k, g) => k, EqualityComparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
     }
index dbaa56f..3db5cb8 100644 (file)
@@ -79,8 +79,7 @@ namespace System.Linq.Tests
         public void OuterEmptyInnerNonEmpty()
         {
             CustomerRec[] outer = { };
-            OrderRec[] inner = new []
-            {
+            OrderRec[] inner = {
                 new OrderRec{ orderID = 45321, custID = 98022, total = 50 },
                 new OrderRec{ orderID = 97865, custID = 32103, total = 25 }
             };
@@ -90,19 +89,16 @@ namespace System.Linq.Tests
         [Fact]
         public void CustomComparer()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
             };
-            AnagramRec[] inner = new []
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
-            JoinRec[] expected = new []
-            {
+            JoinRec[] expected = {
                 new JoinRec{ name = "Tim", orderID = new int?[]{ 93489 }, total = new int?[]{ 45 } },
                 new JoinRec{ name = "Bob", orderID = new int?[]{ }, total = new int?[]{ } },
                 new JoinRec{ name = "Robert", orderID = new int?[]{ 93483 }, total = new int?[]{ 19 } }
@@ -115,8 +111,7 @@ namespace System.Linq.Tests
         public void OuterNull()
         {
             IQueryable<CustomerRec> outer = null;
-            AnagramRec[] inner = new AnagramRec[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
@@ -127,8 +122,7 @@ namespace System.Linq.Tests
         [Fact]
         public void InnerNull()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
@@ -141,14 +135,12 @@ namespace System.Linq.Tests
         [Fact]
         public void OuterKeySelectorNull()
         {
-            CustomerRec[] outer = new CustomerRec[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
             };
-            AnagramRec[] inner = new AnagramRec[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
@@ -159,14 +151,12 @@ namespace System.Linq.Tests
         [Fact]
         public void InnerKeySelectorNull()
         {
-            CustomerRec[] outer = new CustomerRec[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
             };
-            AnagramRec[] inner = new AnagramRec[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
@@ -177,14 +167,12 @@ namespace System.Linq.Tests
         [Fact]
         public void ResultSelectorNull()
         {
-            CustomerRec[] outer = new CustomerRec[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
             };
-            AnagramRec[] inner = new AnagramRec[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
@@ -196,8 +184,7 @@ namespace System.Linq.Tests
         public void OuterNullNoComparer()
         {
             IQueryable<CustomerRec> outer = null;
-            AnagramRec[] inner = new AnagramRec[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
@@ -208,8 +195,7 @@ namespace System.Linq.Tests
         [Fact]
         public void InnerNullNoComparer()
         {
-            CustomerRec[] outer = new[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
@@ -222,14 +208,12 @@ namespace System.Linq.Tests
         [Fact]
         public void OuterKeySelectorNullNoComparer()
         {
-            CustomerRec[] outer = new CustomerRec[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
             };
-            AnagramRec[] inner = new AnagramRec[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
@@ -240,14 +224,12 @@ namespace System.Linq.Tests
         [Fact]
         public void InnerKeySelectorNullNoComparer()
         {
-            CustomerRec[] outer = new CustomerRec[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
             };
-            AnagramRec[] inner = new AnagramRec[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
@@ -258,14 +240,12 @@ namespace System.Linq.Tests
         [Fact]
         public void ResultSelectorNullNoComparer()
         {
-            CustomerRec[] outer = new CustomerRec[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
             };
-            AnagramRec[] inner = new AnagramRec[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
@@ -276,19 +256,16 @@ namespace System.Linq.Tests
         [Fact]
         public void NullComparer()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Tim", custID = 1234 },
                 new CustomerRec{ name = "Bob", custID = 9865 },
                 new CustomerRec{ name = "Robert", custID = 9895 }
             };
-            AnagramRec[] inner = new []
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "Robert", orderID = 93483, total = 19 },
                 new AnagramRec{ name = "miT", orderID = 93489, total = 45 }
             };
-            JoinRec[] expected = new []
-            {
+            JoinRec[] expected = {
                 new JoinRec{ name = "Tim", orderID = new int?[]{ }, total = new int?[]{ } },
                 new JoinRec{ name = "Bob", orderID = new int?[]{ }, total = new int?[]{ } },
                 new JoinRec{ name = "Robert", orderID = new int?[]{ 93483 }, total = new int?[]{ 19 } }
@@ -300,14 +277,14 @@ namespace System.Linq.Tests
         [Fact]
         public void GroupJoin1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().GroupJoin(new int[] { 1, 2, 3 }, n1 => n1, n2 => n2, (n1, n2) => n1).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().GroupJoin(new[] { 1, 2, 3 }, n1 => n1, n2 => n2, (n1, n2) => n1).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void GroupJoin2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().GroupJoin(new int[] { 1, 2, 3 }, n1 => n1, n2 => n2, (n1, n2) => n1, EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().GroupJoin(new[] { 1, 2, 3 }, n1 => n1, n2 => n2, (n1, n2) => n1, EqualityComparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
     }
index 184a618..186a307 100644 (file)
@@ -74,14 +74,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Intersect1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Intersect((new int[] { 1, 2, 3 }).AsQueryable()).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Intersect(new[] { 1, 2, 3 }.AsQueryable()).Count();
             Assert.Equal(2, count);
         }
 
         [Fact]
         public void Intersect2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Intersect((new int[] { 1, 2, 3 }).AsQueryable(), EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Intersect(new[] { 1, 2, 3 }.AsQueryable(), EqualityComparer<int>.Default).Count();
             Assert.Equal(2, count);
         }
 
index 6b6df74..c170867 100644 (file)
@@ -39,20 +39,17 @@ namespace System.Linq.Tests
         [Fact]
         public void FirstOuterMatchesLastInnerLastOuterMatchesFirstInnerSameNumberElements()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
             };
-            OrderRec[] inner = new []
-            {
+            OrderRec[] inner = {
                 new OrderRec{ orderID = 45321, custID = 99022, total = 50 },
                 new OrderRec{ orderID = 43421, custID = 29022, total = 20 },
                 new OrderRec{ orderID = 95421, custID = 98022, total = 9 }
             };
-            JoinRec[] expected = new []
-            {
+            JoinRec[] expected = {
                 new JoinRec{ name = "Prakash", orderID = 95421, total = 9 },
                 new JoinRec{ name = "Robert", orderID = 45321, total = 50 }
             };
@@ -63,18 +60,16 @@ namespace System.Linq.Tests
         [Fact]
         public void NullComparer()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
             };
-            AnagramRec[] inner = new []
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
-            JoinRec[] expected = new [] { new JoinRec{ name = "Prakash", orderID = 323232, total = 9 } };
+            JoinRec[] expected = { new JoinRec{ name = "Prakash", orderID = 323232, total = 9 } };
 
             Assert.Equal(expected, outer.AsQueryable().Join(inner.AsQueryable(), e => e.name, e => e.name, (cr, or) => new JoinRec { name = cr.name, orderID = or.orderID, total = or.total }, null));
         }
@@ -82,19 +77,16 @@ namespace System.Linq.Tests
         [Fact]
         public void CustomComparer()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
             };
-            AnagramRec[] inner = new []
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
-            JoinRec[] expected = new []
-            {
+            JoinRec[] expected = {
                 new JoinRec{ name = "Prakash", orderID = 323232, total = 9 },
                 new JoinRec{ name = "Tim", orderID = 43455, total = 10 }
             };
@@ -106,8 +98,7 @@ namespace System.Linq.Tests
         public void OuterNull()
         {
             IQueryable<CustomerRec> outer = null;
-            AnagramRec[] inner = new []
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
@@ -118,8 +109,7 @@ namespace System.Linq.Tests
         [Fact]
         public void InnerNull()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
@@ -132,14 +122,12 @@ namespace System.Linq.Tests
         [Fact]
         public void OuterKeySelectorNull()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
             };
-            AnagramRec[] inner = new []
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
@@ -150,14 +138,12 @@ namespace System.Linq.Tests
         [Fact]
         public void InnerKeySelectorNull()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
             };
-            AnagramRec[] inner = new []
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
@@ -168,14 +154,12 @@ namespace System.Linq.Tests
         [Fact]
         public void ResultSelectorNull()
         {
-            CustomerRec[] outer = new []
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
             };
-            AnagramRec[] inner = new []
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
@@ -187,8 +171,7 @@ namespace System.Linq.Tests
         public void OuterNullNoComparer()
         {
             IQueryable<CustomerRec> outer = null;
-            AnagramRec[] inner = new[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
@@ -199,8 +182,7 @@ namespace System.Linq.Tests
         [Fact]
         public void InnerNullNoComparer()
         {
-            CustomerRec[] outer = new[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
@@ -213,14 +195,12 @@ namespace System.Linq.Tests
         [Fact]
         public void OuterKeySelectorNullNoComparer()
         {
-            CustomerRec[] outer = new[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
             };
-            AnagramRec[] inner = new[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
@@ -231,14 +211,12 @@ namespace System.Linq.Tests
         [Fact]
         public void InnerKeySelectorNullNoComparer()
         {
-            CustomerRec[] outer = new[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
             };
-            AnagramRec[] inner = new[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
@@ -249,14 +227,12 @@ namespace System.Linq.Tests
         [Fact]
         public void ResultSelectorNullNoComparer()
         {
-            CustomerRec[] outer = new[]
-            {
+            CustomerRec[] outer = {
                 new CustomerRec{ name = "Prakash", custID = 98022 },
                 new CustomerRec{ name = "Tim", custID = 99021 },
                 new CustomerRec{ name = "Robert", custID = 99022 }
             };
-            AnagramRec[] inner = new[]
-            {
+            AnagramRec[] inner = {
                 new AnagramRec{ name = "miT", orderID = 43455, total = 10 },
                 new AnagramRec{ name = "Prakash", orderID = 323232, total = 9 }
             };
@@ -275,14 +251,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Join1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Join(new int[] { 1, 2, 3 }, n1 => n1, n2 => n2, (n1, n2) => n1 + n2).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Join(new[] { 1, 2, 3 }, n1 => n1, n2 => n2, (n1, n2) => n1 + n2).Count();
             Assert.Equal(2, count);
         }
 
         [Fact]
         public void Join2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Join(new int[] { 1, 2, 3 }, n1 => n1, n2 => n2, (n1, n2) => n1 + n2, EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Join(new[] { 1, 2, 3 }, n1 => n1, n2 => n2, (n1, n2) => n1 + n2, EqualityComparer<int>.Default).Count();
             Assert.Equal(2, count);
         }
     }
index d65a9eb..024a2bc 100644 (file)
@@ -86,14 +86,14 @@ namespace System.Linq.Tests.LegacyTests
         [Fact]
         public void LastOrDefault1()
         {
-            var val = (new int[] { 0, 1, 2 }).AsQueryable().LastOrDefault();
+            var val = new[] { 0, 1, 2 }.AsQueryable().LastOrDefault();
             Assert.Equal(2, val);
         }
 
         [Fact]
         public void LastOrDefault2()
         {
-            var val = (new int[] { 0, 1, 2 }).AsQueryable().LastOrDefault(n => n > 1);
+            var val = new[] { 0, 1, 2 }.AsQueryable().LastOrDefault(n => n > 1);
             Assert.Equal(2, val);
         }
 
index 8cc954a..2319e14 100644 (file)
@@ -73,14 +73,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Last1()
         {
-            var val = (new int[] { 0, 1, 2 }).AsQueryable().Last();
+            var val = new[] { 0, 1, 2 }.AsQueryable().Last();
             Assert.Equal(2, val);
         }
 
         [Fact]
         public void Last2()
         {
-            var val = (new int[] { 0, 1, 2 }).AsQueryable().Last(n => n > 1);
+            var val = new[] { 0, 1, 2 }.AsQueryable().Last(n => n > 1);
             Assert.Equal(2, val);
         }
     }
index fcc0f1e..64e2ac1 100644 (file)
@@ -58,14 +58,14 @@ namespace System.Linq.Tests
         [Fact]
         public void LongCount1()
         {
-            var count = (new int[] { 0 }).AsQueryable().LongCount();
+            var count = new[] { 0 }.AsQueryable().LongCount();
             Assert.Equal(1L, count);
         }
 
         [Fact]
         public void LongCount2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().LongCount(n => n > 0);
+            var count = new[] { 0, 1, 2 }.AsQueryable().LongCount(n => n > 0);
             Assert.Equal(2L, count);
         }
     }
index 84a56d5..6c487c7 100644 (file)
@@ -580,14 +580,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Max1()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Max();
+            var val = new[] { 0, 2, 1 }.AsQueryable().Max();
             Assert.Equal(2, val);
         }
 
         [Fact]
         public void Max2()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Max(n => n);
+            var val = new[] { 0, 2, 1 }.AsQueryable().Max(n => n);
             Assert.Equal(2, val);
         }
 
index 8e9a8a6..2cbee36 100644 (file)
@@ -548,14 +548,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Min1()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Min();
+            var val = new[] { 0, 2, 1 }.AsQueryable().Min();
             Assert.Equal(0, val);
         }
 
         [Fact]
         public void Min2()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Min(n => n);
+            var val = new[] { 0, 2, 1 }.AsQueryable().Min(n => n);
             Assert.Equal(0, val);
         }
 
index d8e7bb0..d1688e6 100644 (file)
@@ -32,7 +32,7 @@ namespace System.Linq.Tests
         [Fact]
         public void OfType()
         {
-            var count = (new object[] { 0, (long)1, 2 }).AsQueryable().OfType<int>().Count();
+            var count = new object[] { 0, (long)1, 2 }.AsQueryable().OfType<int>().Count();
             Assert.Equal(2, count);
         }
     }
index 003ee53..a01bbe4 100644 (file)
@@ -80,14 +80,14 @@ namespace System.Linq.Tests
         [Fact]
         public void OrderByDescending1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderByDescending(n => n).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderByDescending(n => n).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void OrderByDescending2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderByDescending(n => n, Comparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderByDescending(n => n, Comparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
     }
index d81142d..f22a437 100644 (file)
@@ -77,14 +77,14 @@ namespace System.Linq.Tests
         [Fact]
         public void OrderBy1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderBy(n => n).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderBy(n => n).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void OrderBy2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderBy(n => n, Comparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderBy(n => n, Comparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
     }
index aa30e2d..e2613e6 100644 (file)
@@ -43,14 +43,14 @@ namespace System.Linq.Tests
         [Fact]
         public void OrderDescending1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderDescending().Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderDescending().Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void OrderDescending2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderDescending(Comparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderDescending(Comparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
     }
index 7cf6925..ac2b969 100644 (file)
@@ -43,14 +43,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Order1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Order().Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Order().Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void Order2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Order(Comparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Order(Comparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
     }
index 314646d..5e11d63 100644 (file)
@@ -76,7 +76,7 @@ namespace System.Linq.Tests
         {
             Expression access = Expression.Property(null, typeof(QueryFromExpressionTests), "AsciiControlCharacters");
             IQueryable<char> q = _prov.CreateQuery<char>(access);
-            Assert.Equal(Enumerable.Range(0, 128).Select(i => (char)i).Where(c => char.IsControl(c)), q);
+            Assert.Equal(Enumerable.Range(0, 128).Select(i => (char)i).Where(char.IsControl), q);
         }
 
         [Fact]
index 5ccedac..1ffd4b4 100644 (file)
@@ -16,13 +16,13 @@ namespace System.Linq.Tests
         [Fact]
         public void AsQueryable()
         {
-            Assert.NotNull(((IEnumerable)(new int[] { })).AsQueryable());
+            Assert.NotNull(((IEnumerable)new int[] { }).AsQueryable());
         }
 
         [Fact]
         public void AsQueryableT()
         {
-            Assert.NotNull((new int[] { }).AsQueryable());
+            Assert.NotNull(new int[] { }.AsQueryable());
         }
 
         [Fact]
index 32a6b46..d26a407 100644 (file)
@@ -15,10 +15,10 @@ namespace System.Linq.Tests
 
         [Theory]
         [InlineData(new int[] { })]
-        [InlineData(new int[] { 1 })]
-        [InlineData(new int[] { 5 })]
-        [InlineData(new int[] { 1, 3, 5 })]
-        [InlineData(new int[] { 2, 4, 6, 8 })]
+        [InlineData(new[] { 1 })]
+        [InlineData(new[] { 5 })]
+        [InlineData(new[] { 1, 3, 5 })]
+        [InlineData(new[] { 2, 4, 6, 8 })]
         public void ReverseMatches(int[] input)
         {
             int[] expectedResults = new int[input.Length];
@@ -33,8 +33,8 @@ namespace System.Linq.Tests
         [Fact]
         public void SomeRepeatedElements()
         {
-            int?[] source = new int?[] { -10, 0, 5, null, 0, 9, 100, null, 9 };
-            int?[] expected = new int?[] { 9, null, 100, 9, 0, null, 5, 0, -10 };
+            int?[] source = { -10, 0, 5, null, 0, 9, 100, null, 9 };
+            int?[] expected = { 9, null, 100, 9, 0, null, 5, 0, -10 };
 
             Assert.Equal(expected, source.AsQueryable().Reverse());
         }
@@ -42,7 +42,7 @@ namespace System.Linq.Tests
         [Fact]
         public void Reverse()
         {
-            var count = (new int[] { 0, 2, 1 }).AsQueryable().Reverse().Count();
+            var count = new[] { 0, 2, 1 }.AsQueryable().Reverse().Count();
             Assert.Equal(3, count);
         }
     }
index ad1b455..8ae9987 100644 (file)
@@ -144,28 +144,28 @@ namespace System.Linq.Tests.LegacyTests
         [Fact]
         public void SelectMany1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().SelectMany(n => new int[] { n + 4, 5 }).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().SelectMany(n => new[] { n + 4, 5 }).Count();
             Assert.Equal(6, count);
         }
 
         [Fact]
         public void SelectMany2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().SelectMany((n, i) => new int[] { 4 + i, 5 + n }).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().SelectMany((n, i) => new[] { 4 + i, 5 + n }).Count();
             Assert.Equal(6, count);
         }
 
         [Fact]
         public void SelectMany3()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().SelectMany(n => new long[] { n + 4, 5 }, (n1, n2) => (n1 + n2).ToString()).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().SelectMany(n => new long[] { n + 4, 5 }, (n1, n2) => (n1 + n2).ToString()).Count();
             Assert.Equal(6, count);
         }
 
         [Fact]
         public void SelectMany4()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().SelectMany((n, i) => new long[] { 4 + i, 5 + n }, (n1, n2) => (n1 + n2).ToString()).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().SelectMany((n, i) => new long[] { 4 + i, 5 + n }, (n1, n2) => (n1 + n2).ToString()).Count();
             Assert.Equal(6, count);
         }
     }
index 0a58cc8..8869ee3 100644 (file)
@@ -69,14 +69,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Select1()
         {
-            var count = (new object[] { 0, 1, 2 }).AsQueryable().Select(o => (int)o).Count();
+            var count = new object[] { 0, 1, 2 }.AsQueryable().Select(o => (int)o).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void Select2()
         {
-            var count = (new object[] { 0, 1, 2 }).AsQueryable().Select((o, i) => (int)o + i).Count();
+            var count = new object[] { 0, 1, 2 }.AsQueryable().Select((o, i) => (int)o + i).Count();
             Assert.Equal(3, count);
         }
     }
index 5925031..1ba47fd 100644 (file)
@@ -57,14 +57,14 @@ namespace System.Linq.Tests
         [Fact]
         public void SequenceEqual1()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().SequenceEqual(new int[] { 0, 2, 1 });
+            var val = new[] { 0, 2, 1 }.AsQueryable().SequenceEqual(new[] { 0, 2, 1 });
             Assert.True(val);
         }
 
         [Fact]
         public void SequenceEqual2()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().SequenceEqual(new int[] { 0, 2, 1 }, EqualityComparer<int>.Default);
+            var val = new[] { 0, 2, 1 }.AsQueryable().SequenceEqual(new[] { 0, 2, 1 }, EqualityComparer<int>.Default);
             Assert.True(val);
         }
     }
index 991ac51..b0b623c 100644 (file)
@@ -69,14 +69,14 @@ namespace System.Linq.Tests
         [Fact]
         public void SingleOrDefault1()
         {
-            var val = (new int[] { 2 }).AsQueryable().SingleOrDefault();
+            var val = new[] { 2 }.AsQueryable().SingleOrDefault();
             Assert.Equal(2, val);
         }
 
         [Fact]
         public void SingleOrDefault2()
         {
-            var val = (new int[] { 2 }).AsQueryable().SingleOrDefault(n => n > 1);
+            var val = new[] { 2 }.AsQueryable().SingleOrDefault(n => n > 1);
             Assert.Equal(2, val);
         }
 
index 68ba9d5..062f7ad 100644 (file)
@@ -77,14 +77,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Single1()
         {
-            var val = (new int[] { 2 }).AsQueryable().Single();
+            var val = new[] { 2 }.AsQueryable().Single();
             Assert.Equal(2, val);
         }
 
         [Fact]
         public void Single2()
         {
-            var val = (new int[] { 2 }).AsQueryable().Single(n => n > 1);
+            var val = new[] { 2 }.AsQueryable().Single(n => n > 1);
             Assert.Equal(2, val);
         }
     }
index 139bd73..3627b44 100644 (file)
@@ -28,7 +28,7 @@ namespace System.Linq.Tests
         [Fact]
         public void Skip()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Skip(1).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Skip(1).Count();
             Assert.Equal(2, count);
         }
     }
index 38e0d7b..755c426 100644 (file)
@@ -34,14 +34,14 @@ namespace System.Linq.Tests
         [Fact]
         public void SkipWhile1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().SkipWhile(n => n < 1).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().SkipWhile(n => n < 1).Count();
             Assert.Equal(2, count);
         }
 
         [Fact]
         public void SkipWhile2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().SkipWhile((n, i) => n + i < 1).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().SkipWhile((n, i) => n + i < 1).Count();
             Assert.Equal(2, count);
         }
     }
index 4b5dc45..c875cce 100644 (file)
@@ -251,140 +251,140 @@ namespace System.Linq.Tests
         [Fact]
         public void Sum1()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((int)3, val);
         }
 
         [Fact]
         public void Sum2()
         {
-            var val = (new int?[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new int?[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((int)3, val);
         }
 
         [Fact]
         public void Sum3()
         {
-            var val = (new long[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new long[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((long)3, val);
         }
 
         [Fact]
         public void Sum4()
         {
-            var val = (new long?[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new long?[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((long)3, val);
         }
 
         [Fact]
         public void Sum5()
         {
-            var val = (new float[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new float[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((float)3, val);
         }
 
         [Fact]
         public void Sum6()
         {
-            var val = (new float?[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new float?[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((float)3, val);
         }
 
         [Fact]
         public void Sum7()
         {
-            var val = (new double[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new double[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((double)3, val);
         }
 
         [Fact]
         public void Sum8()
         {
-            var val = (new double?[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new double?[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((double)3, val);
         }
 
         [Fact]
         public void Sum9()
         {
-            var val = (new decimal[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new decimal[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((decimal)3, val);
         }
 
         [Fact]
         public void Sum10()
         {
-            var val = (new decimal?[] { 0, 2, 1 }).AsQueryable().Sum();
+            var val = new decimal?[] { 0, 2, 1 }.AsQueryable().Sum();
             Assert.Equal((decimal)3, val);
         }
 
         [Fact]
         public void Sum11()
         {
-            var val = (new int[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((int)3, val);
         }
 
         [Fact]
         public void Sum12()
         {
-            var val = (new int?[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new int?[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((int)3, val);
         }
 
         [Fact]
         public void Sum13()
         {
-            var val = (new long[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new long[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((long)3, val);
         }
 
         [Fact]
         public void Sum14()
         {
-            var val = (new long?[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new long?[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((long)3, val);
         }
 
         [Fact]
         public void Sum15()
         {
-            var val = (new float[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new float[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((float)3, val);
         }
 
         [Fact]
         public void Sum16()
         {
-            var val = (new float?[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new float?[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((float)3, val);
         }
 
         [Fact]
         public void Sum17()
         {
-            var val = (new double[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new double[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((double)3, val);
         }
 
         [Fact]
         public void Sum18()
         {
-            var val = (new double?[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new double?[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((double)3, val);
         }
 
         [Fact]
         public void Sum19()
         {
-            var val = (new decimal[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new decimal[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((decimal)3, val);
         }
 
         [Fact]
         public void Sum20()
         {
-            var val = (new decimal?[] { 0, 2, 1 }).AsQueryable().Sum(n => n);
+            var val = new decimal?[] { 0, 2, 1 }.AsQueryable().Sum(n => n);
             Assert.Equal((decimal)3, val);
         }
     }
index 6a0ac95..8d88b32 100644 (file)
@@ -59,14 +59,14 @@ namespace System.Linq.Tests
         [Fact]
         public void TakeWhile1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().TakeWhile(n => n < 2).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().TakeWhile(n => n < 2).Count();
             Assert.Equal(2, count);
         }
 
         [Fact]
         public void TakeWhile2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().TakeWhile((n, i) => n + i < 4).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().TakeWhile((n, i) => n + i < 4).Count();
             Assert.Equal(2, count);
         }
     }
index 6e26654..1c23897 100644 (file)
@@ -63,14 +63,14 @@ namespace System.Linq.Tests
         [Fact]
         public void ThenByDescending1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderBy(n => n).ThenByDescending(n => n).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderBy(n => n).ThenByDescending(n => n).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void ThenByDescending2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderBy(n => n).ThenByDescending(n => n, Comparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderBy(n => n).ThenByDescending(n => n, Comparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
     }
index 3955c2d..75d2e80 100644 (file)
@@ -63,14 +63,14 @@ namespace System.Linq.Tests.LegacyTests
         [Fact]
         public void ThenBy1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderBy(n => n).ThenBy(n => n).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderBy(n => n).ThenBy(n => n).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void ThenBy2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().OrderBy(n => n).ThenBy(n => n, Comparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().OrderBy(n => n).ThenBy(n => n, Comparer<int>.Default).Count();
             Assert.Equal(3, count);
         }
     }
index dfcff83..86faa01 100644 (file)
@@ -46,42 +46,6 @@ namespace System.Linq.Tests
         }
 
         /// <summary>
-        /// Verifies that all methods in CachedReflectionInfo that call MakeGenericMethod
-        /// call it on a method that doesn't contain any trimming annotations (i.e. DynamicallyAccessedMembers).
-        /// </summary>
-        /// <remarks>
-        /// This ensures it is safe to suppress IL2060:MakeGenericMethod warnings in the CachedReflectionInfo class.
-        /// </remarks>
-        [Fact]
-        public static void CachedReflectionInfoMethodsNoAnnotations()
-        {
-            IEnumerable<MethodInfo> methods =
-                typeof(Queryable).Assembly
-                    .GetType("System.Linq.CachedReflectionInfo")
-                    .GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)
-                    .Where(m => m.GetParameters().Length > 0);
-
-            // If you are adding a new method to this class, ensure the method meets these requirements
-            Assert.Equal(135, methods.Count());
-            foreach (MethodInfo method in methods)
-            {
-                ParameterInfo[] parameters = method.GetParameters();
-
-                Type[] args = new Type[parameters.Length];
-                for (int i = 0; i < args.Length; i++)
-                {
-                    args[i] = typeof(object);
-                }
-
-                MethodInfo resultMethodInfo = (MethodInfo)method.Invoke(null, args);
-                Assert.True(resultMethodInfo.IsConstructedGenericMethod);
-                MethodInfo originalGenericDefinition = resultMethodInfo.GetGenericMethodDefinition();
-
-                EnsureNoTrimAnnotations(originalGenericDefinition);
-            }
-        }
-
-        /// <summary>
         /// Verifies that all methods in Enumerable don't contain any trimming annotations (i.e. DynamicallyAccessedMembers).
         /// </summary>
         /// <remarks>
index 1d6d9ae..67fd1ae 100644 (file)
@@ -70,14 +70,14 @@ namespace System.Linq.Tests
         [Fact]
         public void Union1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Union((new int[] { 1, 2, 3 }).AsQueryable()).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Union(new[] { 1, 2, 3 }.AsQueryable()).Count();
             Assert.Equal(4, count);
         }
 
         [Fact]
         public void Union2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Union((new int[] { 1, 2, 3 }).AsQueryable(), EqualityComparer<int>.Default).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Union(new[] { 1, 2, 3 }.AsQueryable(), EqualityComparer<int>.Default).Count();
             Assert.Equal(4, count);
         }
 
index c3454c6..012f69e 100644 (file)
@@ -30,42 +30,42 @@ namespace System.Linq.Tests
         [Fact]
         public void ReturnsExpectedValues_True()
         {
-            int[] source = new[] { 1, 2, 3, 4, 5 };
+            int[] source = { 1, 2, 3, 4, 5 };
             Assert.Equal(source, source.AsQueryable().Where(i => true));
         }
 
         [Fact]
         public void ReturnsExpectedValues_False()
         {
-            int[] source = new[] { 1, 2, 3, 4, 5 };
+            int[] source = { 1, 2, 3, 4, 5 };
             Assert.Empty(source.AsQueryable().Where(i => false));
         }
 
         [Fact]
         public void ReturnsExpectedValuesIndexed_True()
         {
-            int[] source = new[] { 1, 2, 3, 4, 5 };
+            int[] source = { 1, 2, 3, 4, 5 };
             Assert.Equal(source, source.AsQueryable().Where((e, i) => true));
         }
 
         [Fact]
         public void ReturnsExpectedValuesIndexed_False()
         {
-            int[] source = new[] { 1, 2, 3, 4, 5 };
+            int[] source = { 1, 2, 3, 4, 5 };
             Assert.Empty(source.AsQueryable().Where((e, i) => false));
         }
 
         [Fact]
         public void Where1()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Where(n => n > 1).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Where(n => n > 1).Count();
             Assert.Equal(1, count);
         }
 
         [Fact]
         public void Where2()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Where((n, i) => n > 1 || i == 0).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Where((n, i) => n > 1 || i == 0).Count();
             Assert.Equal(2, count);
         }
     }
index 2649869..4f019b2 100644 (file)
@@ -11,9 +11,9 @@ namespace System.Linq.Tests
         [Fact]
         public void CorrectResults()
         {
-            int[] first = new int[] { 1, 2, 3 };
-            int[] second = new int[] { 2, 5, 9 };
-            int[] expected = new int[] { 3, 7, 12 };
+            int[] first = { 1, 2, 3 };
+            int[] second = { 2, 5, 9 };
+            int[] expected = { 3, 7, 12 };
             Assert.Equal(expected, first.AsQueryable().Zip(second.AsQueryable(), (x, y) => x + y));
         }
 
@@ -21,14 +21,14 @@ namespace System.Linq.Tests
         public void FirstIsNull()
         {
             IQueryable<int> first = null;
-            int[] second = new int[] { 2, 5, 9 };
+            int[] second = { 2, 5, 9 };
             AssertExtensions.Throws<ArgumentNullException>("source1", () => first.Zip(second.AsQueryable(), (x, y) => x + y));
         }
 
         [Fact]
         public void SecondIsNull()
         {
-            int[] first = new int[] { 1, 2, 3 };
+            int[] first = { 1, 2, 3 };
             IQueryable<int> second = null;
             AssertExtensions.Throws<ArgumentNullException>("source2", () => first.AsQueryable().Zip(second, (x, y) => x + y));
         }
@@ -36,8 +36,8 @@ namespace System.Linq.Tests
         [Fact]
         public void FuncIsNull()
         {
-            IQueryable<int> first = new int[] { 1, 2, 3 }.AsQueryable();
-            IQueryable<int> second = new int[] { 2, 4, 6 }.AsQueryable();
+            IQueryable<int> first = new[] { 1, 2, 3 }.AsQueryable();
+            IQueryable<int> second = new[] { 2, 4, 6 }.AsQueryable();
             Expression<Func<int, int, int>> func = null;
             AssertExtensions.Throws<ArgumentNullException>("resultSelector", () => first.Zip(second, func));
         }
@@ -45,16 +45,16 @@ namespace System.Linq.Tests
         [Fact]
         public void Zip()
         {
-            var count = (new int[] { 0, 1, 2 }).AsQueryable().Zip((new int[] { 10, 11, 12 }).AsQueryable(), (n1, n2) => n1 + n2).Count();
+            var count = new[] { 0, 1, 2 }.AsQueryable().Zip(new[] { 10, 11, 12 }.AsQueryable(), (n1, n2) => n1 + n2).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void Zip2_CorrectResults()
         {
-            int[] first = new int[] { 1, 2, 3 };
-            int[] second = new int[] { 2, 5, 9 };
-            var expected = new (int, int)[] { (1, 2), (2, 5), (3, 9) };
+            int[] first = { 1, 2, 3 };
+            int[] second = { 2, 5, 9 };
+            var expected = new[] { (1, 2), (2, 5), (3, 9) };
             Assert.Equal(expected, first.AsQueryable().Zip(second.AsQueryable()));
         }
 
@@ -62,14 +62,14 @@ namespace System.Linq.Tests
         public void Zip2_FirstIsNull()
         {
             IQueryable<int> first = null;
-            int[] second = new int[] { 2, 5, 9 };
+            int[] second = { 2, 5, 9 };
             AssertExtensions.Throws<ArgumentNullException>("source1", () => first.Zip(second.AsQueryable()));
         }
 
         [Fact]
         public void Zip2_SecondIsNull()
         {
-            int[] first = new int[] { 1, 2, 3 };
+            int[] first = { 1, 2, 3 };
             IQueryable<int> second = null;
             AssertExtensions.Throws<ArgumentNullException>("source2", () => first.AsQueryable().Zip(second));
         }
@@ -77,15 +77,15 @@ namespace System.Linq.Tests
         [Fact]
         public void Zip2()
         {
-            int count = (new int[] { 0, 1, 2 }).AsQueryable().Zip((new int[] { 10, 11, 12 }).AsQueryable()).Count();
+            int count = new[] { 0, 1, 2 }.AsQueryable().Zip(new[] { 10, 11, 12 }.AsQueryable()).Count();
             Assert.Equal(3, count);
         }
 
         [Fact]
         public void TupleNames()
         {
-            int[] first = new int[] { 1 };
-            int[] second = new int[] { 2 };
+            int[] first = { 1 };
+            int[] second = { 2 };
             var tuple = first.AsQueryable().Zip(second.AsQueryable()).First();
             Assert.Equal(tuple.Item1, tuple.First);
             Assert.Equal(tuple.Item2, tuple.Second);
@@ -94,10 +94,10 @@ namespace System.Linq.Tests
         [Fact]
         public void Zip3_CorrectResults()
         {
-            int[] first = new int[] { 1, 3, 5 };
-            int[] second = new int[] { 2, 6, 8 };
-            int[] third = new int[] { 1, 7, 2 };
-            var expected = new (int, int, int)[] { (1, 2, 1), (3, 6, 7), (5, 8, 2) };
+            int[] first = { 1, 3, 5 };
+            int[] second = { 2, 6, 8 };
+            int[] third = { 1, 7, 2 };
+            var expected = new[] { (1, 2, 1), (3, 6, 7), (5, 8, 2) };
             Assert.Equal(expected, first.AsQueryable().Zip(second.AsQueryable(), third.AsQueryable()));
         }
 
@@ -106,25 +106,25 @@ namespace System.Linq.Tests
         public void Zip3_FirstIsNull()
         {
             IQueryable<int> first = null;
-            int[] second = new int[] { 2, 6, 8 };
-            int[] third = new int[] { 1, 7, 2 };
+            int[] second = { 2, 6, 8 };
+            int[] third = { 1, 7, 2 };
             AssertExtensions.Throws<ArgumentNullException>("source1", () => first.Zip(second.AsQueryable(), third.AsQueryable()));
         }
 
         [Fact]
         public void Zip3_SecondIsNull()
         {
-            int[] first = new int[] { 1, 3, 5 };
+            int[] first = { 1, 3, 5 };
             IQueryable<int> second = null;
-            int[] third = new int[] { 1, 7, 2 };
+            int[] third = { 1, 7, 2 };
             AssertExtensions.Throws<ArgumentNullException>("source2", () => first.AsQueryable().Zip(second, third.AsQueryable()));
         }
 
         [Fact]
         public void Zip3_ThirdIsNull()
         {
-            int[] first = new int[] { 1, 3, 5 };
-            int[] second = new int[] { 2, 6, 8 };
+            int[] first = { 1, 3, 5 };
+            int[] second = { 2, 6, 8 };
             IQueryable<int> third = null;
             AssertExtensions.Throws<ArgumentNullException>("source3", () => first.AsQueryable().Zip(second.AsQueryable(), third));
         }
@@ -132,9 +132,9 @@ namespace System.Linq.Tests
         [Fact]
         public void Zip3_TupleNames()
         {
-            int[] first = new int[] { 1 };
-            int[] second = new int[] { 2 };
-            int[] third = new int[] { 3 };
+            int[] first = { 1 };
+            int[] second = { 2 };
+            int[] third = { 3 };
             var tuple = first.AsQueryable().Zip(second.AsQueryable(), third.AsQueryable()).First();
             Assert.Equal(tuple.Item1, tuple.First);
             Assert.Equal(tuple.Item2, tuple.Second);