55 references to ProducesAttribute
ApiExplorerWebSite (14)
Controllers\ApiExplorerApiController.cs (1)
32
[
Produces
("application/pdf", Type = typeof(Stream))]
Controllers\ApiExplorerResponseContentTypeController.cs (3)
18
[
Produces
("application/json", "text/json")]
25
[
Produces
("application/hal+custom", "application/hal+json")]
32
[
Produces
("application/custom", "text/hal+bson")]
Controllers\ApiExplorerResponseContentTypeOverrideOnActionController.cs (2)
8
[
Produces
("text/xml")]
19
[
Produces
("application/json")]
Controllers\ApiExplorerResponseTypeOverrideOnActionController.cs (1)
8
[
Produces
("application/json", Type = typeof(Product))]
Controllers\ApiExplorerResponseTypeWithApiConventionController.cs (2)
23
[
Produces
("application/json")]
29
[
Produces
("application/json", "text/json")]
Controllers\ApiExplorerResponseTypeWithAttributeController.cs (5)
24
[
Produces
("application/json", Type = typeof(Product))]
31
[
Produces
("application/json", Type = typeof(string))]
45
[
Produces
("application/json", Type = typeof(int))]
65
[
Produces
("text/xml")] // Has status code as 200 but is not applied as it does not set 'Type'
80
[
Produces
("text/xml", Type = typeof(Product))] // Has status code as 200
BasicWebSite (14)
Controllers\ContentNegotiation\FormatFilterController.cs (1)
12
[
Produces
("application/FormatFilterController")]
Controllers\ContentNegotiation\NoProducesContentOnClassController.cs (1)
23
[
Produces
("application/custom_NoProducesContentOnClassController_Action")]
Controllers\ContentNegotiation\NormalController.cs (3)
54
[
Produces
("application/NoFormatter")]
60
[
Produces
("application/custom", "application/json", "text/json")]
66
[
Produces
("application/custom")]
Controllers\ContentNegotiation\ProducesContentBaseController.cs (2)
10
[
Produces
("application/custom_ProducesContentBaseController")]
26
[
Produces
("application/custom_ProducesContentBaseController_Action")]
Controllers\ContentNegotiation\ProducesContentOnClassController.cs (2)
10
[
Produces
("application/custom_ProducesContentOnClassController")]
39
[
Produces
("application/custom_ProducesContentOnClassController_Action")]
Controllers\ContentNegotiation\ProducesJsonController.cs (1)
10
[
Produces
("application/xml")]
Controllers\ContentNegotiation\ProducesWithMediaTypeParametersController.cs (2)
24
[
Produces
("text/vcard;VERSION=V3.0")]
34
[
Produces
("text/vcard;VERSION=V4.0")]
Controllers\ContentNegotiation\ProducesWithMediaTypeSuffixesController.cs (1)
12
[
Produces
("application/vnd.example.contact+json; v=2", "application/vnd.example.contact+xml; v=2")]
Controllers\RazorComponentsController.cs (1)
62
[
Produces
("application/json")]
FormatterWebSite (6)
Controllers\DoNotRespectBrowserAcceptHeaderController.cs (1)
21
[
Produces
("application/xml")]
Controllers\JsonOutputFormatterController.cs (1)
10
[
Produces
("application/json")]
Controllers\StreamController.cs (3)
24
[
Produces
("text/plain")]
31
[
Produces
("text/html", "text/plain")]
38
[
Produces
("text/plain")]
Controllers\SystemTextJsonOutputFormatterController.cs (1)
11
[
Produces
("application/json")]
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (10)
ApiResponseTypeProviderTest.cs (4)
570
actionDescriptor.FilterDescriptors.Add(new FilterDescriptor(new
ProducesAttribute
("application/json"), FilterScope.Controller));
620
actionDescriptor.FilterDescriptors.Add(new FilterDescriptor(new
ProducesAttribute
("application/json") { Type = typeof(string) }, FilterScope.Controller));
683
actionDescriptor.FilterDescriptors.Add(new FilterDescriptor(new
ProducesAttribute
("application/pdf"), FilterScope.Action));
713
actionDescriptor.FilterDescriptors.Add(new FilterDescriptor(new
ProducesAttribute
("text/xml") { Type = typeof(BaseModel) }, FilterScope.Action));
DefaultApiDescriptionProviderTest.cs (5)
643
new
ProducesAttribute
("text/json", "application/json") { Type = typeof(Customer) },
743
new
ProducesAttribute
("text/json", "application/json"),
850
new
ProducesAttribute
("text/json", "application/json"),
920
new
ProducesAttribute
("text/json", "application/json"),
990
new
ProducesAttribute
("text/json", "application/json"),
EndpointMetadataApiDescriptionProviderTest.cs (1)
189
[
Produces
("application/custom")]
Microsoft.AspNetCore.Mvc.Core.Test (9)
Formatters\FormatFilterTest.cs (4)
179
var produces = new
ProducesAttribute
(contentType, new string[] { "application/foo", "text/bar" });
196
var produces = new
ProducesAttribute
("application/xml;version=1", new string[] { });
217
var produces = new
ProducesAttribute
("application/xml", new string[] { });
243
var produces = new
ProducesAttribute
("application/xml", new string[] { "application/foo", "text/bar" });
ProducesAttributeTests.cs (5)
22
var producesContentAttribute = new
ProducesAttribute
("application/json", "text/json;charset=utf-8");
41
var producesContentAttribute = new
ProducesAttribute
("application/xml");
66
var producesContentAttribute = new
ProducesAttribute
("application/xml");
101
() => new
ProducesAttribute
(contentTypes[0], contentTypes.Skip(1).ToArray()));
123
() => new
ProducesAttribute
(contentTypes[0], contentTypes.Skip(1).ToArray()));
Microsoft.AspNetCore.OpenApi.Tests (2)
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Responses.cs (1)
195
builder.MapGet("/api/todos", [
Produces
("application/json", "application/xml")] () => new Todo(1, "Test todo", false, DateTime.Now));
Services\OpenApiSchemaService\OpenApiSchemaService.ResponseSchemas.cs (1)
702
[
Produces
("application/json")]