4 implementations of ContentTypes
Microsoft.AspNetCore.Http.Abstractions (1)
Metadata\AcceptsMetadata.cs (1)
33public IReadOnlyList<string> ContentTypes { get; }
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
2902public IReadOnlyList<string> ContentTypes => new[] { "text/xml", "application/xml" };
Microsoft.AspNetCore.Mvc.Core (1)
ConsumesAttribute.cs (1)
103IReadOnlyList<string> IAcceptsMetadata.ContentTypes => _contentTypes;
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
1124IReadOnlyList<string> IAcceptsMetadata.ContentTypes => _contentTypes;
22 references to ContentTypes
Microsoft.AspNetCore.Http.Extensions.Tests (8)
RequestDelegateFactoryTests.cs (1)
2914Assert.Equal(new[] { "multipart/form-data", "application/x-www-form-urlencoded" }, acceptsMetadata.ContentTypes);
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (7)
49Assert.Equal(new[] { "multipart/form-data" }, acceptsMetadata.ContentTypes); 84Assert.Equal(new[] { "multipart/form-data" }, acceptsMetadata.ContentTypes); 238Assert.Equal(new[] { "multipart/form-data" }, acceptsMetadata.ContentTypes); 421Assert.Equal(new[] { "multipart/form-data" }, acceptsMetadata.ContentTypes); 575Assert.Equal(new[] { "multipart/form-data", "application/x-www-form-urlencoded" }, acceptsMetadata.ContentTypes); 622Assert.Equal(new[] { "multipart/form-data", "application/x-www-form-urlencoded" }, acceptsMetadata.ContentTypes); 853(m) => Assert.Equal(new[] { "multipart/form-data" }, m.ContentTypes));
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
DefaultApiDescriptionProvider.cs (1)
463foreach (var contentType in acceptsMetadata.ContentTypes)
EndpointMetadataApiDescriptionProvider.cs (1)
156foreach (var contentType in acceptsMetadata.ContentTypes)
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiGenerator.cs (1)
277foreach (var contentType in acceptsMetadata.ContentTypes)
Microsoft.AspNetCore.Routing (10)
Matching\AcceptsMatcherPolicy.cs (10)
44return endpoints.Any(e => e.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes.Count > 0); 62if (metadata == null || metadata.ContentTypes?.Count == 0) 79for (var j = 0; j < metadata.ContentTypes?.Count; j++) 81if (string.Equals("*/*", metadata.ContentTypes[j], StringComparison.Ordinal)) 96for (var j = 0; j < metadata.ContentTypes?.Count; j++) 98var candidateMediaType = new ReadOnlyMediaTypeHeaderValue(metadata.ContentTypes[j]); 154var contentTypes = endpoint.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes; 176var contentTypes = endpoint.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes ?? Array.Empty<string>(); 338x?.ContentTypes.Count > 0 ? x : null, 339y?.ContentTypes.Count > 0 ? y : null);
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
693Assert.Equal(new[] { "application/xml" }, endpointMetadata.ContentTypes);