1 write to Metadata
Microsoft.AspNetCore.Http.Abstractions (1)
Routing\Endpoint.cs (1)
31Metadata = metadata ?? EndpointMetadataCollection.Empty;
135 references to Metadata
Microsoft.AspNetCore.Antiforgery (1)
AntiforgeryMiddleware.cs (1)
31if (endpoint?.Metadata.GetMetadata<IAntiforgeryMetadata>() is { RequiresValidation: true })
Microsoft.AspNetCore.Authentication.Cookies (2)
CookieAuthenticationEvents.cs (2)
122return endpoint?.Metadata.GetMetadata<IDisableCookieRedirectMetadata>() is not null && 123endpoint?.Metadata.GetMetadata<IAllowCookieRedirectMetadata>() is null;
Microsoft.AspNetCore.Authorization.Policy (4)
AuthorizationMiddleware.cs (4)
117var authorizeData = endpoint?.Metadata.GetOrderedMetadata<IAuthorizeData>() ?? Array.Empty<IAuthorizeData>(); 119var policies = endpoint?.Metadata.GetOrderedMetadata<AuthorizationPolicy>() ?? Array.Empty<AuthorizationPolicy>(); 123var requirementData = endpoint?.Metadata?.GetOrderedMetadata<IAuthorizationRequirementData>() ?? Array.Empty<IAuthorizationRequirementData>(); 173if (endpoint?.Metadata.GetMetadata<IAllowAnonymous>() != null)
Microsoft.AspNetCore.Components.Endpoints (13)
Assets\ImportMap.cs (1)
52_computedImportMapDefinition = ImportMapDefinition ?? HttpContext?.GetEndpoint()?.Metadata.GetMetadata<ImportMapDefinition>();
BrowserConfiguration\BrowserConfigurationHttpContextExtensions.cs (1)
26var metadataConfig = context.GetEndpoint()?.Metadata.GetMetadata<BrowserConfiguration>();
Builder\RazorComponentEndpointDataSource.cs (1)
140var resourceCollection = endpoints.Count > 0 ? endpoints[^1].Metadata.GetMetadata<ResourceAssetCollection>() : null;
Builder\RazorComponentsEndpointHttpContextExtensions.cs (1)
33var pageType = context.GetEndpoint()?.Metadata.GetMetadata<ComponentTypeMetadata>()?.Type;
RazorComponentEndpointInvoker.cs (4)
63var rootComponent = endpoint.Metadata.GetRequiredMetadata<RootComponentMetadata>().Type; 64var pageComponent = endpoint.Metadata.GetRequiredMetadata<ComponentTypeMetadata>().Type; 71var antiforgeryMetadata = endpoint.Metadata.GetMetadata<IAntiforgeryMetadata>(); 150else if (endpoint.Metadata.GetMetadata<ConfiguredRenderModesMetadata>()?.ConfiguredRenderModes.Length == 0)
Rendering\EndpointHtmlRenderer.cs (2)
154endpoint.Metadata.GetMetadata<ResourceCollectionUrlMetadata>() : 172private static ResourceAssetCollection? GetResourceCollection(HttpContext httpContext) => httpContext.GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
Rendering\EndpointHtmlRenderer.PrerenderingState.cs (1)
25var renderModesMetadata = httpContext.GetEndpoint()?.Metadata.GetMetadata<ConfiguredRenderModesMetadata>();
Rendering\SSRRenderModeBoundary.cs (2)
56var configuredRenderModesMetadata = httpContext.GetEndpoint()?.Metadata.GetMetadata<ConfiguredRenderModesMetadata>(); 132var preloads = _httpContext.GetEndpoint()?.Metadata.GetMetadata<ResourcePreloadCollection>();
Microsoft.AspNetCore.Components.Server (4)
ComponentHub.cs (2)
130var resourceCollection = Context.GetHttpContext().GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>(); 382var resourceCollection = Context.GetHttpContext().GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (2)
152for (var i = 0; i < routeEndpoint.Metadata.Count; i++) 154var metadata = routeEndpoint.Metadata[i];
Microsoft.AspNetCore.Cors (1)
Infrastructure\CorsMiddleware.cs (1)
114var corsMetadata = endpoint?.Metadata.GetMetadata<ICorsMetadata>();
Microsoft.AspNetCore.Diagnostics (4)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (2)
344Metadata = endpoint.Metadata 352var httpMethods = endpoint.Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods;
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
207AdditionalMetadata = exceptionHandlerFeature.Endpoint?.Metadata,
StatusCodePage\StatusCodePagesMiddleware.cs (1)
88var skipStatusCodePageMetadata = endpoint?.Metadata.GetMetadata<ISkipStatusCodePagesMetadata>();
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Logging\IncomingHttpRouteUtility.cs (1)
43var parameters = endpoint?.Metadata.GetMetadata<ControllerActionDescriptor>()?.Parameters;
Microsoft.AspNetCore.Hosting (3)
Internal\HostingApplicationDiagnostics.cs (3)
178var disableHttpRequestDurationMetric = endpoint?.Metadata.GetMetadata<IDisableHttpMetricsMetadata>() != null || context.MetricsTagsFeature.MetricsDisabled; 179var route = endpoint?.Metadata.GetMetadata<IRouteDiagnosticsMetadata>()?.Route; 533var route = endpoint?.Metadata.GetMetadata<IRouteDiagnosticsMetadata>()?.Route;
Microsoft.AspNetCore.Http (4)
Features\FormFeature.cs (1)
394var formOptionsMetadatas = endpoint.Metadata
Timeouts\RequestTimeoutsMiddleware.cs (3)
37var timeoutMetadata = endpoint?.Metadata.GetMetadata<RequestTimeoutAttribute>(); 38var policyMetadata = endpoint?.Metadata.GetMetadata<RequestTimeoutPolicy>(); 47var disableMetadata = endpoint?.Metadata.GetMetadata<DisableRequestTimeoutAttribute>();
Microsoft.AspNetCore.Http.Abstractions (6)
Metadata\IEndpointDescriptionMetadata.cs (1)
7/// Defines a contract used to specify a description in <see cref="Endpoint.Metadata"/>.
Metadata\IEndpointMetadataProvider.cs (1)
21/// Add or remove objects on the <see cref="EndpointBuilder.Metadata"/> property of the <paramref name="builder"/> to modify the <see cref="Endpoint.Metadata"/> being built.
Metadata\IEndpointParameterMetadataProvider.cs (1)
21/// Add or remove objects on the <see cref="EndpointBuilder.Metadata"/> property of the <paramref name="builder"/> to modify the <see cref="Endpoint.Metadata"/> being built.
Metadata\ISkipStatusCodePagesMetadata.cs (1)
8/// middleware in <see cref="Endpoint.Metadata"/>.
Metadata\ISummaryMetadata.cs (1)
7/// Defines a contract used to specify a summary in <see cref="Endpoint.Metadata"/>.
Metadata\ITagsMetadata.cs (1)
7/// Defines a contract used to specify a collection of tags in <see cref="Endpoint.Metadata"/>.
Microsoft.AspNetCore.Http.Extensions (3)
EndpointDescriptionAttribute.cs (1)
10/// Specifies a description for the endpoint in <see cref="Endpoint.Metadata"/>.
EndpointSummaryAttribute.cs (1)
11/// Specifies a summary in <see cref="Endpoint.Metadata"/>.
TagsAttribute.cs (1)
11/// Specifies a collection of tags in <see cref="Endpoint.Metadata"/>.
Microsoft.AspNetCore.HttpLogging (1)
HttpLoggingMiddleware.cs (1)
62var loggingAttribute = context.GetEndpoint()?.Metadata.GetMetadata<HttpLoggingAttribute>();
Microsoft.AspNetCore.Mvc.ApiExplorer (10)
DependencyInjection\EndpointMethodInfoApiExplorerServiceCollectionExtensions.cs (2)
13/// Extensions for configuring ApiExplorer using <see cref="Endpoint.Metadata"/>. 18/// Configures ApiExplorer using <see cref="Endpoint.Metadata"/>.
EndpointMetadataApiDescriptionProvider.cs (8)
61routeEndpoint.Metadata.GetMetadata<MethodInfo>() is { } methodInfo && 62routeEndpoint.Metadata.GetMetadata<IHttpMethodMetadata>() is { } httpMethodMetadata && 63routeEndpoint.Metadata.GetMetadata<IExcludeFromDescriptionMetadata>() is null or { ExcludeFromDescription: false }) 103GroupName = routeEndpoint.Metadata.GetMetadata<IEndpointGroupNameMetadata>()?.EndpointGroupName, 117var parameters = routeEndpoint.Metadata.GetOrderedMetadata<IParameterBindingMetadata>(); 134var acceptsMetadata = routeEndpoint.Metadata.GetMetadata<IAcceptsMetadata>(); 166AddSupportedResponseTypes(apiDescription.SupportedResponseTypes, methodInfo.ReturnType, routeEndpoint.Metadata); 167AddActionDescriptorEndpointMetadata(apiDescription.ActionDescriptor, routeEndpoint.Metadata);
Microsoft.AspNetCore.Mvc.Core (16)
Authorization\AuthorizeFilter.cs (2)
146var endpointAuthorizeData = endpoint.Metadata.GetOrderedMetadata<IAuthorizeData>() ?? Array.Empty<IAuthorizeData>(); 225if (endpoint?.Metadata?.GetMetadata<IAllowAnonymous>() != null)
Infrastructure\ActionSelectionTable.cs (2)
91getRouteKeys: e => e.Metadata.GetMetadata<ActionDescriptor>()?.RouteValues?.Keys, 95e.Metadata.GetMetadata<ActionDescriptor>()?.RouteValues?.TryGetValue(key, out value);
Infrastructure\DefaultApiProblemDetailsWriter.cs (2)
38context.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ControllerAttribute>(); 46context.HttpContext.GetEndpoint()?.Metadata.GetMetadata<IApiBehaviorMetadata>();
Routing\ActionConstraintMatcherPolicy.cs (3)
41var action = endpoint.Metadata.GetMetadata<ActionDescriptor>(); 137var actionDescriptor = endpoint.Metadata.GetMetadata<ActionDescriptor>(); 221var dataTokens = candidate.Endpoint.Metadata.GetMetadata<IDataTokensMetadata>()?.DataTokens;
Routing\ActionEndpointFactory.cs (2)
528var dataTokens = endpoint.Metadata.GetMetadata<IDataTokensMetadata>(); 534var action = endpoint.Metadata.GetMetadata<ActionDescriptor>()!;
Routing\DynamicControllerEndpointMatcherPolicy.cs (4)
42if (endpoints[i].Metadata.GetMetadata<DynamicControllerMetadata>() != null) 48if (endpoints[i].Metadata.GetMetadata<DynamicControllerRouteValueTransformerMetadata>() != null) 83var dynamicControllerMetadata = endpoint.Metadata.GetMetadata<DynamicControllerMetadata>(); 84var transformerMetadata = endpoint.Metadata.GetMetadata<DynamicControllerRouteValueTransformerMetadata>();
Routing\DynamicControllerEndpointSelectorCache.cs (1)
28var dataSourceId = endpoint.Metadata.GetMetadata<ControllerEndpointDataSourceIdMetadata>()!;
Microsoft.AspNetCore.Mvc.Razor (1)
TagHelpers\UrlResolutionTagHelper.cs (1)
340return ViewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
Microsoft.AspNetCore.Mvc.RazorPages (8)
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (6)
45if (endpoints[i].Metadata.GetMetadata<DynamicPageMetadata>() != null) 51if (endpoints[i].Metadata.GetMetadata<DynamicPageRouteValueTransformerMetadata>() != null) 85var dynamicPageMetadata = endpoint.Metadata.GetMetadata<DynamicPageMetadata>(); 86var transformerMetadata = endpoint.Metadata.GetMetadata<DynamicPageRouteValueTransformerMetadata>(); 159var metadata = loadedEndpoints[j].Metadata; 169await _loader.LoadAsync(actionDescriptor, endpoint.Metadata);
Infrastructure\DynamicPageEndpointSelectorCache.cs (2)
29if (endpoint?.Metadata == null) 34var dataSourceId = endpoint.Metadata.GetMetadata<PageEndpointDataSourceIdMetadata>();
Microsoft.AspNetCore.Mvc.TagHelpers (3)
ResourceCollectionUtilities.cs (1)
15var assetCollection = viewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
ScriptTagHelper.cs (2)
195/// the import map will be retrieved by default from the current <see cref="Endpoint.Metadata"/>. 261var importMap = ImportMap ?? ViewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ImportMapDefinition>();
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheMiddleware.cs (1)
234var metadata = httpContext.GetEndpoint()?.Metadata;
Microsoft.AspNetCore.RateLimiting (3)
RateLimitingMiddleware.cs (3)
69if (endpoint?.Metadata.GetMetadata<DisableRateLimitingAttribute>() is not null) 73var enableRateLimitingAttribute = endpoint?.Metadata.GetMetadata<EnableRateLimitingAttribute>(); 258var enableRateLimitingAttribute = context.GetEndpoint()?.Metadata.GetMetadata<EnableRateLimitingAttribute>();
Microsoft.AspNetCore.RequestDecompression (1)
RequestDecompressionMiddleware.cs (1)
62context.GetEndpoint()?.Metadata?.GetMetadata<IRequestSizeLimitMetadata>()?.MaxRequestBodySize
Microsoft.AspNetCore.Routing (43)
Builder\OpenApiRouteHandlerBuilderExtensions.cs (1)
12/// Extension methods for adding <see cref="Endpoint.Metadata"/> that is
Builder\RoutingEndpointConventionBuilderExtensions.cs (1)
131/// in the endpoint <see cref="Http.Endpoint.Metadata"/> for all endpoints produced on the target
EndpointDataSource.cs (3)
69foreach (var metadata in routeEndpoint.Metadata) 108var routeNameMetadata = routeEndpoint.Metadata.GetMetadata<IRouteNameMetadata>(); 123var httpMethodMetadata = routeEndpoint.Metadata.GetMetadata<IHttpMethodMetadata>();
EndpointGroupNameAttribute.cs (1)
7/// Specifies the endpoint group name in <see cref="Microsoft.AspNetCore.Http.Endpoint.Metadata"/>.
EndpointMiddleware.cs (3)
41if (endpoint.Metadata.GetMetadata<IAuthorizeData>() is not null && 47if (endpoint.Metadata.GetMetadata<ICorsMetadata>() is not null && 53if (endpoint.Metadata.GetMetadata<IAntiforgeryMetadata>() is { RequiresValidation: true } &&
EndpointNameAddressScheme.cs (2)
96if (endpoint.Metadata.GetMetadata<ISuppressLinkGenerationMetadata>()?.SuppressLinkGeneration == true) 102return endpoint.Metadata.GetMetadata<IEndpointNameMetadata>()?.EndpointName;
EndpointNameAttribute.cs (1)
9/// Specifies the endpoint name in <see cref="Endpoint.Metadata"/>.
EndpointNameMetadata.cs (1)
11/// Specifies an endpoint name in <see cref="Endpoint.Metadata"/>.
EndpointRoutingMiddleware.cs (7)
120var isFallback = endpoint.Metadata.GetMetadata<FallbackMetadata>() is not null; 131var route = endpoint.Metadata.GetMetadata<IRouteDiagnosticsMetadata>()?.Route ?? "(missing)"; 140var shortCircuitMetadata = endpoint.Metadata.GetMetadata<ShortCircuitMetadata>(); 163if (endpoint.Metadata.GetMetadata<IAuthorizeData>() is not null) 168if (endpoint.Metadata.GetMetadata<ICorsMetadata>() is not null) 173if (endpoint.Metadata.GetMetadata<IAntiforgeryMetadata>() is { RequiresValidation: true } && 304var sizeLimitMetadata = context.GetEndpoint()?.Metadata?.GetMetadata<IRequestSizeLimitMetadata>();
IEndpointGroupNameMetadata.cs (1)
9/// Defines a contract used to specify an endpoint group name in <see cref="Endpoint.Metadata"/>.
IEndpointNameMetadata.cs (1)
9/// Defines a contract use to specify an endpoint name in <see cref="Endpoint.Metadata"/>.
Internal\DfaGraphWriter.cs (1)
47if (endpoints[i] is RouteEndpoint endpoint && (endpoint.Metadata.GetMetadata<ISuppressMatchingMetadata>()?.SuppressMatching ?? false) == false)
Matching\AcceptsMatcherPolicy.cs (4)
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>();
Matching\ContentEncodingNegotiationMatcherPolicy.cs (3)
13private protected override bool HasMetadata(Endpoint endpoint) => endpoint.Metadata.GetMetadata<ContentEncodingMetadata>() != null; 15private protected override string? GetMetadataValue(Endpoint endpoint) => endpoint.Metadata.GetMetadata<ContentEncodingMetadata>()?.Value; 25var metadata = endpoint.Metadata.GetMetadata<ContentEncodingMetadata>();
Matching\DataSourceDependentMatcher.cs (2)
50var endpointName = endpoint.Metadata.GetMetadata<IEndpointNameMetadata>()?.EndpointName; 64if (endpoint.Metadata.GetMetadata<ISuppressMatchingMetadata>()?.SuppressMatching != true)
Matching\EndpointMetadataComparer.cs (2)
69/// a specific type of metadata from <see cref="Endpoint.Metadata"/> for comparison. 109return endpoint.Metadata.GetMetadata<TMetadata>();
Matching\HostMatcherPolicy.cs (3)
50var hosts = e.Metadata.GetMetadata<IHostMetadata>()?.Hosts; 83var hosts = candidates[i].Endpoint.Metadata.GetMetadata<IHostMetadata>()?.Hosts; 280var hostMetadata = endpoint.Metadata.GetMetadata<IHostMetadata>();
Matching\HttpMethodMatcherPolicy.cs (3)
63if (endpoints[i].Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods.Count > 0) 99var metadata = candidates[i].Endpoint?.Metadata.GetMetadata<IHttpMethodMetadata>(); 300var metadata = e.Metadata.GetMetadata<IHttpMethodMetadata>();
Matching\MatcherPolicy.cs (1)
53var metadata = endpoints[i].Metadata.GetMetadata<IDynamicEndpointMetadata>();
RouteValuesAddressScheme.cs (2)
100var metadata = endpoint.Metadata.GetMetadata<IRouteNameMetadata>(); 106if (endpoint.Metadata.GetMetadata<ISuppressLinkGenerationMetadata>()?.SuppressLinkGeneration == true)
Microsoft.AspNetCore.StaticAssets (2)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
178var assetDescriptor = endpoint.Metadata.OfType<StaticAssetDescriptor>().Single();
StaticAssetsInvoker.cs (1)
163if (context.GetEndpoint() is Endpoint { Metadata: { } metadata } && metadata.GetMetadata<BuildAssetMetadata>() != null)