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)
1444
new 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")]
1155
builder.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)
54
action.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)
150
builder => builder.Metadata.Add(new
ConsumesAttribute
("application/json")),
171
builder => builder.Metadata.Add(new
ConsumesAttribute
("application/json")),
192
builder => builder.Metadata.Add(new
ConsumesAttribute
("application/json")),
ApplicationModels\InferParameterBindingInfoConventionTest.cs (1)
992
[
Consumes
("application/json")]
ConsumesAttributeTests.cs (16)
28
var 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()));
84
var constraint = new
ConsumesAttribute
("application/json", "text/xml");
108
var constraint1 = new
ConsumesAttribute
("application/json", "text/xml");
146
var constraint1 = new
ConsumesAttribute
("application/json", "text/xml");
183
var constraint1 = new
ConsumesAttribute
("application/json");
190
var constraint2 = new
ConsumesAttribute
("text/xml");
224
var constraint1 = new
ConsumesAttribute
("application/json");
231
var constraint2 = new
ConsumesAttribute
("text/xml");
262
var constraint1 = new
ConsumesAttribute
("application/json");
269
var constraint2 = new
ConsumesAttribute
("text/xml");
302
var consumesFilter = new
ConsumesAttribute
("application/json");
332
var consumesFilter = new
ConsumesAttribute
("application/json");
361
var consumesFilter = new
ConsumesAttribute
("application/json", "application/xml");
385
var attribute = new
ConsumesAttribute
("application/json", "text/json");
Microsoft.AspNetCore.Mvc.Test (1)
Routing\ActionConstraintMatcherPolicyTest.cs (1)
392
new
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) => { });
730
var 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")]