36 instantiations of AcceptsMetadata
Microsoft.AspNetCore.Http.Abstractions.Tests (4)
MetadataTests.cs (4)
25Assert.Equal("Accepts ContentTypes: application/json, IsOptional: False", new AcceptsMetadata(new[] { "application/json" }).ToString()); 26Assert.Equal("Accepts ContentTypes: application/json,text/plain, IsOptional: False", new AcceptsMetadata(new[] { "application/json", "text/plain" }).ToString()); 27Assert.Equal("Accepts ContentTypes: application/json, RequestType: System.Version, IsOptional: False", new AcceptsMetadata(new[] { "application/json" }, type: typeof(Version)).ToString()); 28Assert.Equal("Accepts ContentTypes: application/json, IsOptional: True", new AcceptsMetadata(new[] { "application/json" }, isOptional: true).ToString());
Microsoft.AspNetCore.Mvc.Core (1)
Routing\ActionEndpointFactory.cs (1)
426builder.Metadata.Add(new AcceptsMetadata(consumesAttribute.ContentTypes.ToArray()));
Microsoft.AspNetCore.OpenApi.Tests (2)
Services\OpenApiGeneratorTests.cs (2)
660new AcceptsMetadata(new string[] { "application/json", "application/xml"}, typeof(string), true) 686new AcceptsMetadata(new string[] { "application/json" }, typeof(InferredJsonClass), true)
Microsoft.AspNetCore.Routing (1)
Builder\OpenApiRouteHandlerBuilderExtensions.cs (1)
280return builder.WithMetadata(new AcceptsMetadata(contentTypes, requestType, isOptional));
Microsoft.AspNetCore.Routing.Tests (28)
Matching\AcceptsMatcherPolicyTest.cs (28)
35CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 53CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 54CreateEndpoint("/", new AcceptsMetadata(new[] { "application/json", })), 72CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>()), new DynamicEndpointMetadata()), 73CreateEndpoint("/", new AcceptsMetadata(new[] { "application/json", })), 106CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>()), new DynamicEndpointMetadata()), 124CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>()), new DynamicEndpointMetadata()), 125CreateEndpoint("/", new AcceptsMetadata(new[] { "application/json", })), 143CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 144CreateEndpoint("/", new AcceptsMetadata(new[] { "application/json", })), 164CreateEndpoint("/", new AcceptsMetadata(new[] { "application/json", "application/*+json", })), 165CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 166CreateEndpoint("/", new AcceptsMetadata(new[] { "application/xml", "application/*+xml", })), 167CreateEndpoint("/", new AcceptsMetadata(new[] { "application/*", })), 168CreateEndpoint("/", new AcceptsMetadata(new[]{ "*/*", })), 224CreateEndpoint("/", new AcceptsMetadata(new[] { "application/json", "application/*+json", })), 225CreateEndpoint("/", new AcceptsMetadata(new[] { "application/xml", "application/*+xml", })), 226CreateEndpoint("/", new AcceptsMetadata(new[] { "application/*", })), 340CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 361CreateEndpoint("/", new AcceptsMetadata(new string[] { "*/*" })), 409CreateEndpoint("/", new AcceptsMetadata(Array.Empty<string>())), 436CreateEndpoint("/", new AcceptsMetadata(new string[] { "*/*" })), 463CreateEndpoint("/", new AcceptsMetadata(new string[] { "application/*+json", })), 490CreateEndpoint("/", new AcceptsMetadata(new string[] { "text/xml", "application/xml", })), 517CreateEndpoint("/", new AcceptsMetadata(new string[] { "text/xml", "application/xml", })), 545CreateEndpoint("/", new AcceptsMetadata(new string[] { "text/xml", "application/xml", })), 574CreateEndpoint("/", new AcceptsMetadata(new string[] { "text/xml", "application/xml", })), 575CreateEndpoint("/", new AcceptsMetadata(new string[] { "*/*", }))
6 references to AcceptsMetadata
Microsoft.AspNetCore.Http.Abstractions (1)
Metadata\AcceptsMetadata.cs (1)
16/// Creates a new instance of <see cref="AcceptsMetadata"/> with a type.
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateFactoryTests.cs (1)
2824m => Assert.True(m is AcceptsMetadata am && am.RequestType == typeof(AddsCustomParameterMetadata)),
Microsoft.AspNetCore.Mvc.Core (1)
Routing\ActionEndpointFactory.cs (1)
424!builder.Metadata.OfType<AcceptsMetadata>().Any())
Microsoft.AspNetCore.Routing.Tests (3)
Builder\OpenApiRouteHandlerBuilderExtensionsTest.cs (2)
114var metadata = Assert.IsType<AcceptsMetadata>(Assert.Single(testBuilder.Metadata));
Matching\AcceptsMatcherPolicyTest.cs (1)
598private static RouteEndpoint CreateEndpoint(string template, AcceptsMetadata consumesMetadata, params object[] more)