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