@@ -15,19 +15,7 @@ namespace Microsoft.AspNetCore.Http.Validation;
1515internal static class ValidationEndpointFilterFactory
1616{
1717 // A small struct to hold the validatable parameter details to avoid allocating arrays for parameters that don't need validation
18- private readonly struct ValidatableParameterEntry
19- {
20- public ValidatableParameterEntry ( int index , IValidatableInfo parameter , string displayName )
21- {
22- Index = index ;
23- Parameter = parameter ;
24- DisplayName = displayName ;
25- }
26-
27- public int Index { get ; }
28- public IValidatableInfo Parameter { get ; }
29- public string DisplayName { get ; }
30- }
18+ private readonly record struct ValidatableParameterEntry ( int Index , IValidatableInfo Parameter , string DisplayName ) ;
3119
3220 public static EndpointFilterDelegate Create ( EndpointFilterFactoryContext context , EndpointFilterDelegate next )
3321 {
@@ -41,7 +29,7 @@ public static EndpointFilterDelegate Create(EndpointFilterFactoryContext context
4129 var serviceProviderIsService = context . ApplicationServices . GetService < IServiceProviderIsService > ( ) ;
4230
4331 // Use a list to only store validatable parameters instead of arrays for all parameters
44- var validatableParameters = new System . Collections . Generic . List < ValidatableParameterEntry > ( ) ;
32+ var validatableParameters = new List < ValidatableParameterEntry > ( ) ;
4533
4634 for ( var i = 0 ; i < parameters . Length ; i ++ )
4735 {
@@ -73,7 +61,7 @@ public static EndpointFilterDelegate Create(EndpointFilterFactoryContext context
7361 {
7462 if ( entry . Index >= context . Arguments . Count )
7563 {
76- continue ;
64+ break ;
7765 }
7866
7967 var argument = context . Arguments [ entry . Index ] ;
0 commit comments