48 references to ConsumesAttribute
BasicWebSite (13)
Controllers\ActionConstraints\ConsumesAttribute_MediaTypeSuffix.cs (2)
12[Consumes("application/vnd.example+json")] 21[Consumes("application/vnd.example+xml")]
Controllers\ActionConstraints\ConsumesAttribute_NoFallBackActionController.cs (2)
12[Consumes("application/json", "text/json")] 18[Consumes("application/xml")]
Controllers\ActionConstraints\ConsumesAttribute_OveridesBaseController.cs (2)
9[Consumes("application/json")] 12[Consumes("text/json")]
Controllers\ActionConstraints\ConsumesAttribute_OveridesController.cs (1)
9[Consumes("application/xml")]
Controllers\ActionConstraints\ConsumesAttribute_PassThroughController.cs (3)
12[Consumes("application/json")] 18[Consumes("application/json")] 24[Consumes("application/xml")]
Controllers\ActionConstraints\ConsumesAttribute_WithFallbackActionController.cs (2)
11[Consumes("application/json")] 18[Consumes("application/xml")]
Controllers\FiltersController.cs (1)
13[Consumes("application/yaml")]
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (6)
DefaultApiDescriptionProviderTest.cs (1)
1444new FilterDescriptor(new ConsumesAttribute("multipart/form-data"), FilterScope.Action),
EndpointMetadataApiDescriptionProviderTest.cs (5)
73[Consumes("application/custom")] 78[Consumes("application/custom")] 87[Consumes("application/custom0", "application/custom1")] 1155builder.MapPost("/api/todos", [Consumes("application/xml")] (InferredJsonClass? inferredJsonClass) => ""); 1273[Consumes("application/custom0", "application/custom1")] (IFormFile file) => Results.NoContent());
Microsoft.AspNetCore.Mvc.Core (1)
ApplicationModels\ConsumesConstraintForFormFileParameterConvention.cs (1)
54action.Filters.Add(new ConsumesAttribute("multipart/form-data"));
Microsoft.AspNetCore.Mvc.Core.Test (21)
ApplicationModels\ConsumesConstraintForFormFileParameterConventionTest.cs (1)
91[Consumes("application/json")]
ApplicationModels\EndpointMetadataProviderTest.cs (3)
150builder => builder.Metadata.Add(new ConsumesAttribute("application/json")), 171builder => builder.Metadata.Add(new ConsumesAttribute("application/json")), 192builder => builder.Metadata.Add(new ConsumesAttribute("application/json")),
ApplicationModels\InferParameterBindingInfoConventionTest.cs (1)
992[Consumes("application/json")]
ConsumesAttributeTests.cs (16)
28var exception = Assert.Throws<FormatException>(() => new ConsumesAttribute(contentType)); 46() => new ConsumesAttribute(contentTypes[0], contentTypes.Skip(1).ToArray())); 66() => new ConsumesAttribute(contentTypes[0], contentTypes.Skip(1).ToArray())); 84var constraint = new ConsumesAttribute("application/json", "text/xml"); 108var constraint1 = new ConsumesAttribute("application/json", "text/xml"); 146var constraint1 = new ConsumesAttribute("application/json", "text/xml"); 183var constraint1 = new ConsumesAttribute("application/json"); 190var constraint2 = new ConsumesAttribute("text/xml"); 224var constraint1 = new ConsumesAttribute("application/json"); 231var constraint2 = new ConsumesAttribute("text/xml"); 262var constraint1 = new ConsumesAttribute("application/json"); 269var constraint2 = new ConsumesAttribute("text/xml"); 302var consumesFilter = new ConsumesAttribute("application/json"); 332var consumesFilter = new ConsumesAttribute("application/json"); 361var consumesFilter = new ConsumesAttribute("application/json", "application/xml"); 385var attribute = new ConsumesAttribute("application/json", "text/json");
Microsoft.AspNetCore.Mvc.Test (1)
Routing\ActionConstraintMatcherPolicyTest.cs (1)
392new ConsumesAttribute("text/json"),
Microsoft.AspNetCore.OpenApi.Tests (5)
Services\OpenApiGeneratorTests.cs (5)
92[Consumes("application/custom")] (InferredJsonClass fromBody) => { })); 95[Consumes("application/custom")] ([FromBody] int fromBody) => { })); 102[Consumes("application/custom0", "application/custom1")] (InferredJsonClass fromBody) => { }); 730var operation = GetOpenApiOperation([Consumes("application/xml")] (InferredJsonClass? inferredJsonClass) => ""); 786[Consumes("application/custom0", "application/custom1")] (IFormFile file) => Results.NoContent());
Mvc.RoutingWebSite (1)
Controllers\ConsumesAttributeController.cs (1)
12[Consumes("application/json")]