54 instantiations of 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 (8)
DefaultApiDescriptionProviderTest.cs (1)
1444
new FilterDescriptor(new
ConsumesAttribute
("multipart/form-data"), FilterScope.Action),
EndpointMetadataApiDescriptionProviderTest.cs (7)
73
[
Consumes
("application/custom")]
78
[
Consumes
("application/custom")]
87
[
Consumes
("application/custom0", "application/custom1")]
106
[
Consumes
(typeof(InferredJsonClass), "application/custom0", "application/custom1", IsOptional = true)]
121
[
Consumes
(typeof(InferredJsonClass), "application/custom0", "application/custom1", IsOptional = false)]
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 (9)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.RequestBody.cs (2)
240
builder.MapPost("/", [
Consumes
(typeof(IFormFile), "application/magic-foo-content-type")] (IFormFile formFile) => { });
363
builder.MapPost("/", [
Consumes
(typeof(string), "application/magic-foo-content-type")] (string name) => { });
Services\OpenApiGeneratorTests.cs (7)
92
[
Consumes
("application/custom")] (InferredJsonClass fromBody) => { }));
95
[
Consumes
("application/custom")] ([FromBody] int fromBody) => { }));
102
[
Consumes
("application/custom0", "application/custom1")] (InferredJsonClass fromBody) => { });
115
[
Consumes
(typeof(InferredJsonClass), "application/custom0", "application/custom1", IsOptional = true)] () => { });
132
[
Consumes
(typeof(InferredJsonClass), "application/custom0", "application/custom1", IsOptional = false)] (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")]
22 references to ConsumesAttribute
Microsoft.AspNetCore.Mvc.Core (5)
ApplicationModels\ConsumesConstraintForFormFileParameterConvention.cs (1)
11
/// An <see cref="IActionModelConvention"/> that adds a <see cref="
ConsumesAttribute
"/> with <c>multipart/form-data</c>
ConsumesAttribute.cs (2)
35
/// Creates a new instance of <see cref="
ConsumesAttribute
"/>.
57
/// Creates a new instance of <see cref="
ConsumesAttribute
"/>.
Routing\ActionConstraintMatcherPolicy.cs (1)
62
else if (actionConstraint.GetType() == typeof(
ConsumesAttribute
))
Routing\ActionEndpointFactory.cs (1)
423
else if (actionConstraint is
ConsumesAttribute
consumesAttribute &&
Microsoft.AspNetCore.Mvc.Core.Test (17)
ApplicationModels\ConsumesConstraintForFormFileParameterConventionTest.cs (4)
26
var
consumesAttribute = Assert.IsType<
ConsumesAttribute
>(attribute);
47
var
consumesAttribute = Assert.IsType<
ConsumesAttribute
>(attribute);
ConsumesAttributeTests.cs (13)
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");