102 references to GetMetadata
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 (1)
AuthorizationMiddleware.cs (1)
173if (endpoint?.Metadata.GetMetadata<IAllowAnonymous>() != null)
Microsoft.AspNetCore.Components.Endpoints (11)
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 (2)
71var antiforgeryMetadata = endpoint.Metadata.GetMetadata<IAntiforgeryMetadata>(); 150else if (endpoint.Metadata.GetMetadata<ConfiguredRenderModesMetadata>()?.ConfiguredRenderModes.Length == 0)
Rendering\EndpointHtmlRenderer.cs (2)
159endpoint.Metadata.GetMetadata<ResourceCollectionUrlMetadata>() : 177private 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)
60var configuredRenderModesMetadata = httpContext.GetEndpoint()?.Metadata.GetMetadata<ConfiguredRenderModesMetadata>(); 154var preloads = _httpContext.GetEndpoint()?.Metadata.GetMetadata<ResourcePreloadCollection>();
Microsoft.AspNetCore.Components.Server (2)
ComponentHub.cs (2)
130var resourceCollection = Context.GetHttpContext().GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>(); 382var resourceCollection = Context.GetHttpContext().GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
Microsoft.AspNetCore.Cors (1)
Infrastructure\CorsMiddleware.cs (1)
114var corsMetadata = endpoint?.Metadata.GetMetadata<ICorsMetadata>();
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
352var httpMethods = endpoint.Metadata.GetMetadata<IHttpMethodMetadata>()?.HttpMethods;
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 (3)
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 (1)
Routing\EndpointMetadataCollection.cs (1)
140var metadata = GetMetadata<T>();
Microsoft.AspNetCore.HttpLogging (1)
HttpLoggingMiddleware.cs (1)
62var loggingAttribute = context.GetEndpoint()?.Metadata.GetMetadata<HttpLoggingAttribute>();
Microsoft.AspNetCore.Mvc.ApiExplorer (6)
EndpointMetadataApiDescriptionProvider.cs (6)
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, 134var acceptsMetadata = routeEndpoint.Metadata.GetMetadata<IAcceptsMetadata>(); 332var errorMetadata = endpointMetadata.GetMetadata<ProducesErrorResponseTypeAttribute>();
Microsoft.AspNetCore.Mvc.Core (17)
Authorization\AuthorizeFilter.cs (1)
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 (4)
37var controllerAttribute = context.AdditionalMetadata?.GetMetadata<ControllerAttribute>() ?? 38context.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ControllerAttribute>(); 45var apiControllerAttribute = context.AdditionalMetadata?.GetMetadata<IApiBehaviorMetadata>() ?? 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 (6)
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (5)
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>(); 160var actionDescriptor = metadata.GetMetadata<PageActionDescriptor>();
Infrastructure\DynamicPageEndpointSelectorCache.cs (1)
34var dataSourceId = endpoint.Metadata.GetMetadata<PageEndpointDataSourceIdMetadata>();
Microsoft.AspNetCore.Mvc.TagHelpers (2)
ResourceCollectionUtilities.cs (1)
15var assetCollection = viewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
ScriptTagHelper.cs (1)
261var importMap = ImportMap ?? ViewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ImportMapDefinition>();
Microsoft.AspNetCore.OutputCaching (2)
OutputCacheMiddleware.cs (2)
236var policy = metadata?.GetMetadata<IOutputCachePolicy>(); 244var attribute = metadata?.GetMetadata<OutputCacheAttribute>();
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 (34)
EndpointDataSource.cs (2)
108var routeNameMetadata = routeEndpoint.Metadata.GetMetadata<IRouteNameMetadata>(); 123var httpMethodMetadata = routeEndpoint.Metadata.GetMetadata<IHttpMethodMetadata>();
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;
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>();
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 (1)
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 (1)
StaticAssetsInvoker.cs (1)
163if (context.GetEndpoint() is Endpoint { Metadata: { } metadata } && metadata.GetMetadata<BuildAssetMetadata>() != null)