@@ -15,19 +15,7 @@ namespace Microsoft.AspNetCore.Http.Validation;
15
15
internal static class ValidationEndpointFilterFactory
16
16
{
17
17
// 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 ) ;
31
19
32
20
public static EndpointFilterDelegate Create ( EndpointFilterFactoryContext context , EndpointFilterDelegate next )
33
21
{
@@ -41,7 +29,7 @@ public static EndpointFilterDelegate Create(EndpointFilterFactoryContext context
41
29
var serviceProviderIsService = context . ApplicationServices . GetService < IServiceProviderIsService > ( ) ;
42
30
43
31
// 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 > ( ) ;
45
33
46
34
for ( var i = 0 ; i < parameters . Length ; i ++ )
47
35
{
@@ -73,7 +61,7 @@ public static EndpointFilterDelegate Create(EndpointFilterFactoryContext context
73
61
{
74
62
if ( entry . Index >= context . Arguments . Count )
75
63
{
76
- continue ;
64
+ break ;
77
65
}
78
66
79
67
var argument = context . Arguments [ entry . Index ] ;
0 commit comments