@@ -21,8 +21,6 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels;
21
21
internal class DefaultApplicationModelProvider : IApplicationModelProvider
22
22
#pragma warning restore CA1852 // Seal internal types
23
23
{
24
- private static readonly MethodInfo PopulateMetadataForEndpointMethod = typeof ( EndpointMetadataPopulator ) . GetMethod ( nameof ( PopulateMetadataForEndpoint ) , BindingFlags . NonPublic | BindingFlags . Static ) ! ;
25
-
26
24
private readonly MvcOptions _mvcOptions ;
27
25
private readonly IModelMetadataProvider _modelMetadataProvider ;
28
26
private readonly Func < ActionContext , bool > _supportsAllRequests ;
@@ -374,8 +372,8 @@ internal static void AddReturnTypeMetadata(IList<SelectorModel> selectors, Metho
374
372
var invokeArgs = new object [ 2 ] ;
375
373
invokeArgs [ 0 ] = methodInfo ;
376
374
invokeArgs [ 1 ] = builder ;
377
- PopulateMetadataForEndpointMethod . MakeGenericMethod ( returnType ) . Invoke ( null , invokeArgs ) ;
378
-
375
+ EndpointMetadataPopulator . PopulateMetadataForEndpointMethod . MakeGenericMethod ( returnType ) . Invoke ( null , invokeArgs ) ;
376
+
379
377
// The metadata is added to the builder's metadata collection.
380
378
// We need to populate the selectors with that metadata.
381
379
foreach ( var metadata in builder . Metadata )
@@ -712,12 +710,6 @@ private static void AddRange<T>(IList<T> list, IEnumerable<T> items)
712
710
}
713
711
}
714
712
715
- private static void PopulateMetadataForEndpoint < T > ( MethodInfo method , EndpointBuilder builder )
716
- where T : IEndpointMetadataProvider
717
- {
718
- T . PopulateMetadata ( method , builder ) ;
719
- }
720
-
721
713
private sealed class InertEndpointBuilder : EndpointBuilder
722
714
{
723
715
public override Endpoint Build ( )
0 commit comments