80 references to AcceptsMetadata
Microsoft.AspNetCore.Http.Abstractions.Tests (4)
MetadataTests.cs (4)
25
Assert.Equal("Accepts ContentTypes: application/json, IsOptional: False", new
AcceptsMetadata
(new[] { "application/json" }).ToString());
26
Assert.Equal("Accepts ContentTypes: application/json,text/plain, IsOptional: False", new
AcceptsMetadata
(new[] { "application/json", "text/plain" }).ToString());
27
Assert.Equal("Accepts ContentTypes: application/json, RequestType: System.Version, IsOptional: False", new
AcceptsMetadata
(new[] { "application/json" }, type: typeof(Version)).ToString());
28
Assert.Equal("Accepts ContentTypes: application/json, IsOptional: True", new
AcceptsMetadata
(new[] { "application/json" }, isOptional: true).ToString());
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
2070
factoryContext.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(contentTypes, type, factoryContext.AllowEmptyRequestBody));
Microsoft.AspNetCore.Identity (8)
GeneratedRouteBuilderExtensions.g.cs (8)
73
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: typeof(global::Microsoft.AspNetCore.Identity.Data.RegisterRequest), isOptional: false, contentTypes: GeneratedMetadataConstants.JsonContentType));
192
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: typeof(global::Microsoft.AspNetCore.Identity.Data.LoginRequest), isOptional: false, contentTypes: GeneratedMetadataConstants.JsonContentType));
378
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: typeof(global::Microsoft.AspNetCore.Identity.Data.RefreshRequest), isOptional: false, contentTypes: GeneratedMetadataConstants.JsonContentType));
640
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: typeof(global::Microsoft.AspNetCore.Identity.Data.ResendConfirmationEmailRequest), isOptional: false, contentTypes: GeneratedMetadataConstants.JsonContentType));
759
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: typeof(global::Microsoft.AspNetCore.Identity.Data.ForgotPasswordRequest), isOptional: false, contentTypes: GeneratedMetadataConstants.JsonContentType));
875
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: typeof(global::Microsoft.AspNetCore.Identity.Data.ResetPasswordRequest), isOptional: false, contentTypes: GeneratedMetadataConstants.JsonContentType));
991
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: typeof(global::Microsoft.AspNetCore.Identity.Data.TwoFactorRequest), isOptional: false, contentTypes: GeneratedMetadataConstants.JsonContentType));
1212
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: typeof(global::Microsoft.AspNetCore.Identity.Data.InfoRequest), isOptional: false, contentTypes: GeneratedMetadataConstants.JsonContentType));
Microsoft.AspNetCore.JsonPatch (2)
JsonPatchDocument.cs (1)
240
builder.Metadata.Add(new
AcceptsMetadata
(["application/json-patch+json"], parameter.ParameterType));
JsonPatchDocumentOfT.cs (1)
676
builder.Metadata.Add(new
AcceptsMetadata
(["application/json-patch+json"], typeof(TModel)));
Microsoft.AspNetCore.JsonPatch.SystemTextJson (2)
JsonPatchDocument.cs (1)
232
builder.Metadata.Add(new
AcceptsMetadata
(["application/json-patch+json"], parameter.ParameterType));
JsonPatchDocumentOfT.cs (1)
668
builder.Metadata.Add(new
AcceptsMetadata
(["application/json-patch+json"], typeof(TModel)));
Microsoft.AspNetCore.Mvc.Core (1)
Routing\ActionEndpointFactory.cs (1)
426
builder.Metadata.Add(new
AcceptsMetadata
(consumesAttribute.ContentTypes.ToArray()));
Microsoft.AspNetCore.OpenApi.Tests (2)
Services\OpenApiGeneratorTests.cs (2)
669
new
AcceptsMetadata
(new string[] { "application/json", "application/xml"}, typeof(string), true)
697
new
AcceptsMetadata
(new string[] { "application/json" }, typeof(InferredJsonClass), true)
Microsoft.AspNetCore.Routing (1)
Builder\OpenApiRouteHandlerBuilderExtensions.cs (1)
280
return builder.WithMetadata(new
AcceptsMetadata
(contentTypes, requestType, isOptional));
Microsoft.AspNetCore.Routing.Tests (28)
Matching\AcceptsMatcherPolicyTest.cs (28)
35
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
53
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
54
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", })),
72
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>()), new DynamicEndpointMetadata()),
73
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", })),
106
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>()), new DynamicEndpointMetadata()),
124
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>()), new DynamicEndpointMetadata()),
125
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", })),
143
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
144
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", })),
164
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", "application/*+json", })),
165
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
166
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/xml", "application/*+xml", })),
167
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/*", })),
168
CreateEndpoint("/", new
AcceptsMetadata
(new[]{ "*/*", })),
224
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/json", "application/*+json", })),
225
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/xml", "application/*+xml", })),
226
CreateEndpoint("/", new
AcceptsMetadata
(new[] { "application/*", })),
340
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
361
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "*/*" })),
409
CreateEndpoint("/", new
AcceptsMetadata
(Array.Empty<string>())),
436
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "*/*" })),
463
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "application/*+json", })),
490
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "text/xml", "application/xml", })),
517
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "text/xml", "application/xml", })),
545
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "text/xml", "application/xml", })),
574
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "text/xml", "application/xml", })),
575
CreateEndpoint("/", new
AcceptsMetadata
(new string[] { "*/*", }))
Sample (31)
artifacts\obj\Sample\Release\net10.0\generated\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Microsoft.AspNetCore.Http.RequestDelegateGenerator.RequestDelegateGenerator\GeneratedRouteBuilderExtensions.g.cs (31)
185
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(contentTypes: GeneratedMetadataConstants.FormFileContentType));
306
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(contentTypes: GeneratedMetadataConstants.FormFileContentType));
427
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(contentTypes: GeneratedMetadataConstants.FormFileContentType));
1253
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
1377
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
1626
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
1748
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
2040
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
2159
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
2278
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
2397
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
2516
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
2635
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
2754
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
2873
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
2996
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
3119
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
3245
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
3457
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
3580
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
3703
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
3998
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
4121
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
4244
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
4666
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
5085
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
5209
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
5328
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
5447
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
5566
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));
5685
options.EndpointBuilder.Metadata.Add(new
AcceptsMetadata
(type: type, isOptional: isOptional, contentTypes: GeneratedMetadataConstants.JsonContentType));