@@ -21,8 +21,6 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels;
2121internal class DefaultApplicationModelProvider : IApplicationModelProvider
2222#pragma warning restore CA1852 // Seal internal types
2323{
24- private static readonly MethodInfo PopulateMetadataForEndpointMethod = typeof ( EndpointMetadataPopulator ) . GetMethod ( nameof ( PopulateMetadataForEndpoint ) , BindingFlags . NonPublic | BindingFlags . Static ) ! ;
25-
2624 private readonly MvcOptions _mvcOptions ;
2725 private readonly IModelMetadataProvider _modelMetadataProvider ;
2826 private readonly Func < ActionContext , bool > _supportsAllRequests ;
@@ -374,8 +372,8 @@ internal static void AddReturnTypeMetadata(IList<SelectorModel> selectors, Metho
374372 var invokeArgs = new object [ 2 ] ;
375373 invokeArgs [ 0 ] = methodInfo ;
376374 invokeArgs [ 1 ] = builder ;
377- PopulateMetadataForEndpointMethod . MakeGenericMethod ( returnType ) . Invoke ( null , invokeArgs ) ;
378-
375+ EndpointMetadataPopulator . PopulateMetadataForEndpointMethod . MakeGenericMethod ( returnType ) . Invoke ( null , invokeArgs ) ;
376+
379377 // The metadata is added to the builder's metadata collection.
380378 // We need to populate the selectors with that metadata.
381379 foreach ( var metadata in builder . Metadata )
@@ -712,12 +710,6 @@ private static void AddRange<T>(IList<T> list, IEnumerable<T> items)
712710 }
713711 }
714712
715- private static void PopulateMetadataForEndpoint < T > ( MethodInfo method , EndpointBuilder builder )
716- where T : IEndpointMetadataProvider
717- {
718- T . PopulateMetadata ( method , builder ) ;
719- }
720-
721713 private sealed class InertEndpointBuilder : EndpointBuilder
722714 {
723715 public override Endpoint Build ( )
0 commit comments