3 interfaces inheriting from IParameterPolicy
Microsoft.AspNetCore.Routing (1)
Matching\IParameterLiteralNodeMatchingPolicy.cs (1)
12
public interface IParameterLiteralNodeMatchingPolicy :
IParameterPolicy
Microsoft.AspNetCore.Routing.Abstractions (2)
IOutboundParameterTransformer.cs (1)
10
public interface IOutboundParameterTransformer :
IParameterPolicy
IRouteConstraint.cs (1)
17
public interface IRouteConstraint :
IParameterPolicy
9 implementations of IParameterPolicy
Microsoft.AspNetCore.Routing.Tests (9)
DefaultParameterPolicyFactoryTest.cs (7)
450
public class CustomParameterPolicy :
IParameterPolicy
454
public class CustomParameterPolicyWithArguments :
IParameterPolicy
466
public class CustomParameterPolicyWithMultipleCtors :
IParameterPolicy
483
public class CustomParameterPolicyWithMultipleCtorsInAscendingOrder :
IParameterPolicy
508
public class CustomParameterPolicyWithAmbiguousMultipleCtors :
IParameterPolicy
530
public class CustomParameterPolicyWithMultipleArguments :
IParameterPolicy
546
public class CustomParameterPolicyWithOnlyServiceArguments :
IParameterPolicy
Matching\DfaMatcherBuilderTest.cs (1)
3465
private class CustomParameterPolicy :
IParameterPolicy
RouteTest.cs (1)
1867
private class TestPolicy :
IParameterPolicy
68 references to IParameterPolicy
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointMetadataApiDescriptionProvider.cs (1)
232
var
policy = _parameterPolicyFactory.Create(parameterPart, parameterPolicyReference);
Microsoft.AspNetCore.Routing (49)
DefaultLinkParser.cs (1)
98
var
policy = _parameterPolicyFactory.Create(parameter, kvp.Value[i]);
DefaultParameterPolicyFactory.cs (6)
23
public override
IParameterPolicy
Create(RoutePatternParameterPart? parameter,
IParameterPolicy
parameterPolicy)
35
public override
IParameterPolicy
Create(RoutePatternParameterPart? parameter, string inlineText)
39
var
parameterPolicy = ParameterPolicyActivator.ResolveParameterPolicy<
IParameterPolicy
>(
61
private static
IParameterPolicy
InitializeRouteConstraint(
MapRouteRouteBuilderExtensions.cs (1)
161
var
parameterPolicy = _parameterPolicyFactory.Create(null!, inlineConstraint);
Matching\DfaMatcherBuilder.cs (11)
119
private readonly Dictionary<string,
IParameterPolicy
> _cachedParameters;
124
_cachedParameters = new Dictionary<string,
IParameterPolicy
>(StringComparer.Ordinal);
127
public override
IParameterPolicy
Create(RoutePatternParameterPart parameter, string inlineText)
133
if (_cachedParameters.TryGetValue(inlineText, out
var
parameterPolicy))
141
var
createdParameterPolicy = (parameterPolicy is OptionalRouteConstraint optionalRouteConstraint)
155
public override
IParameterPolicy
Create(RoutePatternParameterPart parameter,
IParameterPolicy
parameterPolicy)
405
var
parameterPolicy = _parameterPolicyFactory.Create(parameterPart, reference);
436
var
parameterPolicy = _parameterPolicyFactory.Create(parameterPart, reference);
480
var
parameterPolicy = _parameterPolicyFactory.Create(parameterPart, reference);
818
var
parameterPolicy = _parameterPolicyFactory.Create(parameter, reference);
ParameterPolicyActivator.cs (4)
22
where T :
IParameterPolicy
39
if (!typeof(
IParameterPolicy
).IsAssignableFrom(parameterPolicyType))
97
private static
IParameterPolicy
CreateParameterPolicy(IServiceProvider? serviceProvider, Type parameterPolicyType, string? argumentString)
143
return (
IParameterPolicy
)activationConstructor.Invoke(parameters);
ParameterPolicyFactory.cs (8)
10
/// Defines an abstraction for resolving inline parameter policies as instances of <see cref="
IParameterPolicy
"/>.
19
/// <returns>The <see cref="
IParameterPolicy
"/> for the parameter.</returns>
20
public abstract
IParameterPolicy
Create(RoutePatternParameterPart? parameter, string inlineText);
27
/// <returns>The <see cref="
IParameterPolicy
"/> for the parameter.</returns>
28
public abstract
IParameterPolicy
Create(RoutePatternParameterPart? parameter,
IParameterPolicy
parameterPolicy);
35
/// <returns>The <see cref="
IParameterPolicy
"/> for the parameter.</returns>
36
public
IParameterPolicy
Create(RoutePatternParameterPart? parameter, RoutePatternParameterPolicyReference reference)
Patterns\DefaultRoutePatternTransformer.cs (1)
203
var
policy = _policyFactory.Create(parameter, policies[i]);
Patterns\RoutePatternFactory.cs (4)
659
if (kvp.Value is
IParameterPolicy
parameterPolicy)
673
policyReferences.Add(item is
IParameterPolicy
p ? ParameterPolicy(p) : Constraint(item));
1002
public static RoutePatternParameterPolicyReference ParameterPolicy(
IParameterPolicy
parameterPolicy)
1145
private static RoutePatternParameterPolicyReference ParameterPolicyCore(
IParameterPolicy
parameterPolicy)
Patterns\RoutePatternParameterPolicyReference.cs (3)
24
internal RoutePatternParameterPolicyReference(
IParameterPolicy
parameterPolicy)
35
/// Gets a pre-existing <see cref="
IParameterPolicy
"/> that was used to construct this reference.
37
public
IParameterPolicy
? ParameterPolicy { get; }
RouteOptions.cs (4)
152
public void SetParameterPolicy<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(string token) where T :
IParameterPolicy
162
/// <exception cref="InvalidOperationException">Throws an exception if the type is not an <see cref="
IParameterPolicy
"/>.</exception>
165
if (!type.IsAssignableTo(typeof(
IParameterPolicy
)))
167
throw new InvalidOperationException($"{type} must implement {typeof(
IParameterPolicy
)}");
Template\DefaultTemplateBinderFactory.cs (2)
39
var policies = new List<(string parameterName,
IParameterPolicy
policy)>();
51
var
parameterPolicy = _policyFactory.Create(parameter, kvp.Value[i]);
Template\TemplateBinder.cs (4)
61
/// A list of (<see cref="string"/>, <see cref="
IParameterPolicy
"/>) pairs to evaluate when producing a URI.
69
IEnumerable<(string parameterName,
IParameterPolicy
policy)>? parameterPolicies)
99
IEnumerable<(string parameterName,
IParameterPolicy
policy)> parameterPolicies)
128
IEnumerable<(string parameterName,
IParameterPolicy
policy)>? parameterPolicies,
Microsoft.AspNetCore.Routing.Tests (18)
DefaultParameterPolicyFactoryTest.cs (17)
48
$"The constraint type '{typeof(string)}' which is mapped to constraint key 'bad' must implement the '{nameof(
IParameterPolicy
)}' interface.",
65
var
parameterPolicy = factory.Create(parameter, parameter.ParameterPolicies[0]);
84
var
parameterPolicy = factory.Create(parameter, parameter.ParameterPolicies[0]);
104
var
parameterPolicy = factory.Create(parameter, parameter.ParameterPolicies[0]);
123
var
parameterPolicy = factory.Create(parameter, parameter.ParameterPolicies[0]);
143
var
parameterPolicy = factory.Create(parameter, parameter.ParameterPolicies[0]);
156
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id"), "int");
169
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id"), "range(1,20)");
184
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id", @default: null, RoutePatternParameterKind.Optional), "int");
204
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id", @default: null, RoutePatternParameterKind.Optional), "customParameterPolicy");
223
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id"), "customConstraintPolicy(20)");
244
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id"), "customConstraintPolicy(20,-1)");
267
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id"), "customConstraintPolicy");
288
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id"), "customConstraintPolicy(1)");
309
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id"), "customConstraintPolicy(1)");
352
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id"), @"regex-service(\\d{1,2})");
393
var
parameterPolicy = factory.Create(RoutePatternFactory.ParameterPart("id", @default: null, RoutePatternParameterKind.Optional), "customParameterPolicy");
Template\TemplateBinderTests.cs (1)
1305
parameterPolicies: new (string,
IParameterPolicy
)[] { ("param", new LengthRouteConstraint(500)), ("param", new SlugifyParameterTransformer()), });