4 implementations of IAcceptsMetadata
Microsoft.AspNetCore.Http.Abstractions (1)
Metadata\AcceptsMetadata.cs (1)
13public sealed class AcceptsMetadata : IAcceptsMetadata
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
DefaultApiDescriptionProviderTest.cs (1)
2900private class XmlOnlyMetadata : Http.Metadata.IAcceptsMetadata
Microsoft.AspNetCore.Mvc.Core (1)
ConsumesAttribute.cs (1)
26IAcceptsMetadata
Microsoft.AspNetCore.Routing.Tests (1)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (1)
1104class TestConsumesAttribute : Attribute, IAcceptsMetadata
68 references to IAcceptsMetadata
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactoryOptions.cs (1)
46/// <see cref="IAcceptsMetadata"/> that <see cref="RequestDelegateFactory.Create(Delegate, RequestDelegateFactoryOptions?)"/> infers automatically
Microsoft.AspNetCore.Http.Extensions.Tests (32)
RequestDelegateFactoryTests.cs (11)
2910var allAcceptsMetadata = metadataResult.EndpointMetadata.OfType<IAcceptsMetadata>(); 2911var acceptsMetadata = Assert.Single(allAcceptsMetadata); 2944Assert.DoesNotContain(result.EndpointMetadata, m => m is IAcceptsMetadata); 2957Assert.DoesNotContain(result.EndpointMetadata, m => m is IAcceptsMetadata); 2970Assert.DoesNotContain(result.EndpointMetadata, m => m is IAcceptsMetadata); 2983Assert.DoesNotContain(result.EndpointMetadata, m => m is IAcceptsMetadata); 2996Assert.DoesNotContain(result.EndpointMetadata, m => m is IAcceptsMetadata); 3010Assert.DoesNotContain(result.EndpointMetadata, m => m is IAcceptsMetadata); 3375if (metadata is IAcceptsMetadata) 3393if (metadata is IAcceptsMetadata) 3411if (metadata is IAcceptsMetadata)
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (13)
45var allAcceptsMetadata = endpoint.Metadata.OfType<IAcceptsMetadata>(); 46var acceptsMetadata = Assert.Single(allAcceptsMetadata); 80var allAcceptsMetadata = endpoint.Metadata.OfType<IAcceptsMetadata>(); 81var acceptsMetadata = Assert.Single(allAcceptsMetadata); 234var allAcceptsMetadata = endpoint.Metadata.OfType<IAcceptsMetadata>(); 235var acceptsMetadata = Assert.Single(allAcceptsMetadata); 417var allAcceptsMetadata = endpoint.Metadata.OfType<IAcceptsMetadata>(); 418var acceptsMetadata = Assert.Single(allAcceptsMetadata); 571var allAcceptsMetadata = endpoint.Metadata.OfType<IAcceptsMetadata>(); 572var acceptsMetadata = Assert.Single(allAcceptsMetadata); 618var allAcceptsMetadata = endpoint.Metadata.OfType<IAcceptsMetadata>(); 619var acceptsMetadata = Assert.Single(allAcceptsMetadata); 851var allAcceptsMetadata = endpoint.Metadata.OfType<IAcceptsMetadata>();
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (6)
288Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata); 303Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata); 318Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata); 333Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata); 348Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata); 532m => Assert.True(m is IAcceptsMetadata am && am.RequestType == typeof(AddsCustomParameterMetadata)),
RequestDelegateGenerator\SharedTypes.cs (2)
649if (metadata is IAcceptsMetadata) 667if (metadata is IAcceptsMetadata)
Microsoft.AspNetCore.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (2)
649if (metadata is IAcceptsMetadata) 667if (metadata is IAcceptsMetadata)
Microsoft.AspNetCore.Mvc.ApiExplorer (5)
DefaultApiDescriptionProvider.cs (3)
129var acceptsMetadata = action.EndpointMetadata.OfType<IAcceptsMetadata>().LastOrDefault(); 454internal static MediaTypeCollection GetDeclaredContentTypes(IReadOnlyList<IApiRequestMetadataProvider>? requestMetadataAttributes, IAcceptsMetadata? acceptsMetadata)
EndpointMetadataApiDescriptionProvider.cs (2)
133var acceptsMetadata = routeEndpoint.Metadata.GetMetadata<IAcceptsMetadata>();
Microsoft.AspNetCore.Mvc.Core (2)
ConsumesAttribute.cs (2)
101Type? IAcceptsMetadata.RequestType => _requestType; 103IReadOnlyList<string> IAcceptsMetadata.ContentTypes => _contentTypes;
Microsoft.AspNetCore.Mvc.Core.Test (7)
ApplicationModels\EndpointMetadataProviderTest.cs (7)
158Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata); 179Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata); 200Assert.DoesNotContain(endpoint.Metadata, m => m is IAcceptsMetadata); 444if (metadata is IAcceptsMetadata) 463if (metadata is IAcceptsMetadata) 483if (metadata is IAcceptsMetadata) 501if (metadata is IAcceptsMetadata)
Microsoft.AspNetCore.OpenApi (2)
Services\OpenApiGenerator.cs (2)
272var acceptsMetadata = metadata.GetMetadata<IAcceptsMetadata>();
Microsoft.AspNetCore.Routing (12)
Builder\OpenApiRouteHandlerBuilderExtensions.cs (4)
209/// Adds <see cref="IAcceptsMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints 226/// Adds <see cref="IAcceptsMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints 245/// Adds <see cref="IAcceptsMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints 263/// Adds <see cref="IAcceptsMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all endpoints
Matching\AcceptsMatcherPolicy.cs (8)
44return endpoints.Any(e => e.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes.Count > 0); 61var metadata = candidates[i].Endpoint?.Metadata.GetMetadata<IAcceptsMetadata>(); 154var contentTypes = endpoint.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes; 176var contentTypes = endpoint.Metadata.GetMetadata<IAcceptsMetadata>()?.ContentTypes ?? Array.Empty<string>(); 332private sealed class ConsumesMetadataEndpointComparer : EndpointMetadataComparer<IAcceptsMetadata> 334protected override int CompareMetadata(IAcceptsMetadata? x, IAcceptsMetadata? y)
Microsoft.AspNetCore.Routing.Tests (5)
Builder\RouteHandlerEndpointRouteBuilderExtensionsTest.cs (5)
688var endpointMetadata = endpoint.Metadata.GetMetadata<IAcceptsMetadata>(); 1124IReadOnlyList<string> IAcceptsMetadata.ContentTypes => _contentTypes; 1125Type? IAcceptsMetadata.RequestType => _requestType; 1127bool IAcceptsMetadata.IsOptional => false;