49 writes to ActionConstraints
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
141
action.
ActionConstraints
= new List<IActionConstraintMetadata>()
Microsoft.AspNetCore.Mvc.Core (1)
ApplicationModels\ControllerActionDescriptorBuilder.cs (1)
185
actionDescriptor.
ActionConstraints
= new List<IActionConstraintMetadata>(selectorModel.ActionConstraints);
Microsoft.AspNetCore.Mvc.Core.Test (20)
ActionConstraints\ActionConstraintCacheTest.cs (3)
24
ActionConstraints
= new[]
61
ActionConstraints
= new[]
98
ActionConstraints
= new[]
ConsumesAttributeTests.cs (3)
305
ActionConstraints
= new List<IActionConstraintMetadata>() { consumesFilter },
335
ActionConstraints
= new List<IActionConstraintMetadata>() { consumesFilter },
364
ActionConstraints
= new List<IActionConstraintMetadata>() { consumesFilter },
Infrastructure\ActionSelectorTest.cs (14)
525
ActionConstraints
= new List<IActionConstraintMetadata>()
555
ActionConstraints
= new List<IActionConstraintMetadata>()
563
ActionConstraints
= new List<IActionConstraintMetadata>()
587
ActionConstraints
= new List<IActionConstraintMetadata>()
596
ActionConstraints
= new List<IActionConstraintMetadata>()
621
ActionConstraints
= new List<IActionConstraintMetadata>()
653
ActionConstraints
= new List<IActionConstraintMetadata>()
680
ActionConstraints
= new List<IActionConstraintMetadata>()
710
ActionConstraints
= new List<IActionConstraintMetadata>()
718
ActionConstraints
= new List<IActionConstraintMetadata>()
743
ActionConstraints
= new List<IActionConstraintMetadata>()
753
ActionConstraints
= new List<IActionConstraintMetadata>()
779
ActionConstraints
= new List<IActionConstraintMetadata>()
789
ActionConstraints
= new List<IActionConstraintMetadata>()
Microsoft.AspNetCore.Mvc.RazorPages (2)
ApplicationModels\CompiledPageActionDescriptorBuilder.cs (1)
47
ActionConstraints
= actionDescriptor.ActionConstraints,
Infrastructure\PageActionDescriptorProvider.cs (1)
92
ActionConstraints
= selector.ActionConstraints.ToList(),
Microsoft.AspNetCore.Mvc.RazorPages.Test (5)
ApplicationModels\CompiledPageActionDescriptorBuilderTest.cs (5)
22
ActionConstraints
= new List<IActionConstraintMetadata>(),
51
ActionConstraints
= new List<IActionConstraintMetadata>(),
102
ActionConstraints
= new List<IActionConstraintMetadata>(),
144
ActionConstraints
= new List<IActionConstraintMetadata>(),
405
ActionConstraints
= new List<IActionConstraintMetadata>(),
Microsoft.AspNetCore.Mvc.Test (19)
Routing\ActionConstraintMatcherPolicyTest.cs (19)
46
ActionConstraints
= new List<IActionConstraintMetadata>()
79
ActionConstraints
= new List<IActionConstraintMetadata>()
87
ActionConstraints
= new List<IActionConstraintMetadata>()
114
ActionConstraints
= new List<IActionConstraintMetadata>()
123
ActionConstraints
= new List<IActionConstraintMetadata>()
151
ActionConstraints
= new List<IActionConstraintMetadata>()
159
ActionConstraints
= new List<IActionConstraintMetadata>()
185
ActionConstraints
= new List<IActionConstraintMetadata>()
195
ActionConstraints
= new List<IActionConstraintMetadata>()
224
ActionConstraints
= new List<IActionConstraintMetadata>()
232
ActionConstraints
= new List<IActionConstraintMetadata>()
260
ActionConstraints
= new List<IActionConstraintMetadata>()
270
ActionConstraints
= new List<IActionConstraintMetadata>()
299
ActionConstraints
= new List<IActionConstraintMetadata>()
309
ActionConstraints
= new List<IActionConstraintMetadata>()
343
ActionConstraints
= new List<IActionConstraintMetadata>()
383
ActionConstraints
= new List<IActionConstraintMetadata>()
390
ActionConstraints
= new List<IActionConstraintMetadata>()
419
ActionConstraints
= new List<IActionConstraintMetadata>()
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
227
action.
ActionConstraints
= [new HttpMethodActionConstraint(["GET"])];
70 references to ActionConstraints
Microsoft.AspNetCore.Mvc.ApiExplorer (3)
DefaultApiDescriptionProvider.cs (3)
365
if (action.
ActionConstraints
!= null && action.
ActionConstraints
.Count > 0)
367
return action.
ActionConstraints
.OfType<HttpMethodActionConstraint>().SelectMany(c => c.HttpMethods);
Microsoft.AspNetCore.Mvc.Core (9)
ActionConstraints\ActionConstraintCache.cs (5)
54
if (action.
ActionConstraints
== null || action.
ActionConstraints
.Count == 0)
59
var items = new List<ActionConstraintItem>(action.
ActionConstraints
.Count);
60
for (var i = 0; i < action.
ActionConstraints
.Count; i++)
62
items.Add(new ActionConstraintItem(action.
ActionConstraints
[i]));
Routing\ActionConstraintMatcherPolicy.cs (1)
42
if (action?.
ActionConstraints
is IList<IActionConstraintMetadata> { Count: > 0 } constraints && HasSignificantActionConstraint(constraints))
Routing\ActionEndpointFactory.cs (3)
409
if (action.
ActionConstraints
!= null && action.
ActionConstraints
.Count > 0)
416
foreach (var actionConstraint in action.
ActionConstraints
)
Microsoft.AspNetCore.Mvc.Core.Test (54)
ActionConstraints\ActionConstraintCacheTest.cs (6)
38
a => Assert.Same(action.
ActionConstraints
[0], a), // Copied by provider
39
a => Assert.Same(action.
ActionConstraints
[1], a)); // Copied by provider
75
a => Assert.NotSame(action.
ActionConstraints
[0], a), // Created by factory
76
a => Assert.Same(action.
ActionConstraints
[1], a)); // Copied by provider
112
a => Assert.NotSame(action.
ActionConstraints
[0], a), // Created by factory
113
a => Assert.Same(action.
ActionConstraints
[1], a)); // Copied by provider
ApplicationModels\ControllerActionDescriptorProviderTests.cs (48)
94
var constraint = Assert.IsType<HttpMethodActionConstraint>(Assert.Single(descriptor.
ActionConstraints
));
111
var constraint = Assert.IsType<HttpMethodActionConstraint>(Assert.Single(descriptor.
ActionConstraints
));
485
Assert.NotNull(action.
ActionConstraints
);
486
var methodConstraint = Assert.IsType<HttpMethodActionConstraint>(Assert.Single(action.
ActionConstraints
));
510
Assert.NotNull(action.
ActionConstraints
);
511
var methodConstraint = Assert.IsType<HttpMethodActionConstraint>(Assert.Single(action.
ActionConstraints
));
541
var constrainedActions = actions.Where(a => a.
ActionConstraints
!= null);
546
a => a.
ActionConstraints
.OfType<HttpMethodActionConstraint>().Single().HttpMethods.Single() == "PUT");
553
a => a.
ActionConstraints
.OfType<HttpMethodActionConstraint>().Single().HttpMethods.Single() == "POST");
580
var constrainedActions = actions.Where(a => a.
ActionConstraints
!= null);
585
a => a.
ActionConstraints
.OfType<HttpMethodActionConstraint>().Single().HttpMethods.Single() == "POST");
592
a => a.
ActionConstraints
.OfType<HttpMethodActionConstraint>().Single().HttpMethods.Single() == "PUT");
598
var unconstrainedActions = actions.Where(a => a.
ActionConstraints
== null);
646
a => a.
ActionConstraints
749
Assert.Null(action.
ActionConstraints
);
1192
Assert.Equal(2, action.
ActionConstraints
.Count);
1193
Assert.Single(action.
ActionConstraints
, a => a is RouteAndConstraintAttribute);
1194
Assert.Single(action.
ActionConstraints
, a => a is ConstraintAttribute);
1198
Assert.Equal(2, action.
ActionConstraints
.Count);
1199
Assert.Single(action.
ActionConstraints
, a => a is RouteAndConstraintAttribute);
1200
Assert.Single(action.
ActionConstraints
, a => a is ConstraintAttribute);
1217
Assert.Equal(3, action.
ActionConstraints
.Count);
1218
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "C1");
1219
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "A1");
1220
Assert.Single(action.
ActionConstraints
, a => a is ConstraintAttribute);
1223
Assert.Equal(3, action.
ActionConstraints
.Count);
1224
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "C2");
1225
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "A1");
1226
Assert.Single(action.
ActionConstraints
, a => a is ConstraintAttribute);
1244
Assert.Equal(3, action.
ActionConstraints
.Count);
1245
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "C1");
1246
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "A3");
1247
Assert.Single(action.
ActionConstraints
, a => a is ConstraintAttribute);
1250
Assert.Equal(3, action.
ActionConstraints
.Count);
1251
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "C2");
1252
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "A3");
1253
Assert.Single(action.
ActionConstraints
, a => a is ConstraintAttribute);
1256
Assert.Equal(3, action.
ActionConstraints
.Count);
1257
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "C1");
1258
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "A4");
1259
Assert.Single(action.
ActionConstraints
, a => a is ConstraintAttribute);
1262
Assert.Equal(3, action.
ActionConstraints
.Count);
1263
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "C2");
1264
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "A4");
1265
Assert.Single(action.
ActionConstraints
, a => a is ConstraintAttribute);
1283
Assert.Equal(2, action.
ActionConstraints
.Count);
1284
Assert.Single(action.
ActionConstraints
, a => (a as RouteAndConstraintAttribute)?.Template == "~/A2");
1285
Assert.Single(action.
ActionConstraints
, a => a is ConstraintAttribute);
Microsoft.AspNetCore.Mvc.RazorPages (1)
ApplicationModels\CompiledPageActionDescriptorBuilder.cs (1)
47
ActionConstraints = actionDescriptor.
ActionConstraints
,
Microsoft.AspNetCore.Mvc.RazorPages.Test (3)
ApplicationModels\CompiledPageActionDescriptorBuilderTest.cs (2)
38
Assert.Same(actionDescriptor.
ActionConstraints
, actual.
ActionConstraints
);
Infrastructure\PageActionDescriptorProviderTest.cs (1)
198
var actual = Assert.Single(descriptor.
ActionConstraints
);