4 implementations of Set
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\HttpProtocol.Generated.cs (1)
651void IFeatureCollection.Set<TFeature>(TFeature? feature) where TFeature : default
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
341void IFeatureCollection.Set<TFeature>(TFeature? feature) where TFeature : default
src\aspnetcore\src\Servers\Kestrel\shared\TransportMultiplexedConnection.Generated.cs (1)
251void IFeatureCollection.Set<TFeature>(TFeature? feature) where TFeature : default
Microsoft.Extensions.Features (1)
FeatureCollection.cs (1)
138public void Set<TFeature>(TFeature? instance)
112 references to Set
Aspire.Dashboard (1)
Authentication\Connection\ConnectionTypeMiddleware.cs (1)
26context.Features.Set<IConnectionTypeFeature>(new ConnectionTypeFeature { ConnectionTypes = _connectionTypes });
Aspire.Dashboard.Tests (1)
BrowserSecurityHeadersMiddlewareTests.cs (1)
74httpContext.Features.Set<IConnectionTypeFeature>(new TestConnectionTypeFeature { ConnectionTypes = [connectionType] });
Microsoft.AspNetCore.Antiforgery (3)
AntiforgeryMiddleware.cs (2)
44context.Features.Set(AntiforgeryValidationFeature.Valid); 48context.Features.Set<IAntiforgeryValidationFeature>(new AntiforgeryValidationFeature(false, e));
Internal\DefaultAntiforgery.cs (1)
272httpContext.Features.Set(antiforgeryFeature);
Microsoft.AspNetCore.Authentication (3)
AuthenticationMiddleware.cs (3)
42context.Features.Set<IAuthenticationFeature>(new AuthenticationFeature 70context.Features.Set<IHttpAuthenticationFeature>(authFeatures); 71context.Features.Set<IAuthenticateResultFeature>(authFeatures);
Microsoft.AspNetCore.Authorization.Policy (2)
AuthorizationMiddleware.cs (2)
167context.Features.Set<IHttpAuthenticationFeature>(authFeatures); 168context.Features.Set<IAuthenticateResultFeature>(authFeatures);
Microsoft.AspNetCore.Components.Server (1)
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
101ctx.Features.Set<IHttpWebSocketFeature>(new ServerComponentsSocketFeature(currentFeature!, ctx, configureConnection, disableCompression));
Microsoft.AspNetCore.Connections.Abstractions (6)
DefaultConnectionContext.cs (6)
48Features.Set<IConnectionUserFeature>(this); 49Features.Set<IConnectionItemsFeature>(this); 50Features.Set<IConnectionIdFeature>(this); 51Features.Set<IConnectionTransportFeature>(this); 52Features.Set<IConnectionLifetimeFeature>(this); 53Features.Set<IConnectionEndPointFeature>(this);
Microsoft.AspNetCore.CookiePolicy (2)
CookiePolicyMiddleware.cs (2)
67context.Features.Set<IResponseCookiesFeature>(new CookiesWrapperFeature(wrapper)); 68context.Features.Set<ITrackingConsentFeature>(wrapper);
Microsoft.AspNetCore.Diagnostics (7)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (2)
96httpContext.Features.Set<IExceptionHandlerFeature>(exceptionHandlerFeature); 97httpContext.Features.Set<IExceptionHandlerPathFeature>(exceptionHandlerFeature);
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (2)
165context.Features.Set<IExceptionHandlerFeature>(exceptionHandlerFeature); 166context.Features.Set<IExceptionHandlerPathFeature>(exceptionHandlerFeature);
StatusCodePage\StatusCodePagesExtensions.cs (2)
237context.HttpContext.Features.Set<IStatusCodeReExecuteFeature>(new StatusCodeReExecuteFeature() 273context.HttpContext.Features.Set<IStatusCodeReExecuteFeature?>(null);
StatusCodePage\StatusCodePagesMiddleware.cs (1)
42context.Features.Set<IStatusCodePagesFeature>(statusCodeFeature);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (6)
Latency\AddServerTimingHeaderMiddlewareTests.cs (1)
39context.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature);
Latency\RequestLatencyTelemetryMiddlewareTests.cs (5)
39httpContextMock.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature); 69httpContextMock.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature); 97httpContextMock.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature); 128httpContextMock.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature); 221httpContextMock.Features.Set(feature.Object);
Microsoft.AspNetCore.HeaderParsing (1)
HeaderParsingHttpRequestExtensions.cs (1)
31context.Features.Set(feature);
Microsoft.AspNetCore.Hosting (2)
Internal\HostingApplicationDiagnostics.cs (2)
79httpContext.Features.Set<IHttpMetricsTagsFeature>(context.MetricsTagsFeature); 115httpContext.Features.Set<IHttpActivityFeature>(context.HttpActivityFeature);
Microsoft.AspNetCore.Http (8)
DefaultHttpContext.cs (3)
54Features.Set<IHttpRequestFeature>(new HttpRequestFeature()); 55Features.Set<IHttpResponseFeature>(new HttpResponseFeature()); 56Features.Set<IHttpResponseBodyFeature>(new StreamResponseBodyFeature(Stream.Null));
Internal\DefaultHttpResponse.cs (2)
79_features.Collection.Set(streamFeature.PriorFeature); 83_features.Collection.Set<IHttpResponseBodyFeature>(new StreamResponseBodyFeature(value, otherFeature));
RequestFormReaderExtensions.cs (1)
37features.Set<IFormFeature>(new FormFeature(request, options));
Timeouts\RequestTimeoutsMiddleware.cs (2)
104context.Features.Set<IHttpRequestTimeoutFeature>(feature); 133context.Features.Set<IHttpRequestTimeoutFeature>(null);
Microsoft.AspNetCore.Http.Abstractions (1)
Routing\EndpointHttpContextExtensions.cs (1)
45context.Features.Set(feature);
Microsoft.AspNetCore.Http.Connections (14)
Internal\HttpConnectionContext.cs (12)
89Features.Set<IConnectionUserFeature>(this); 90Features.Set<IConnectionItemsFeature>(this); 91Features.Set<IConnectionIdFeature>(this); 92Features.Set<IConnectionTransportFeature>(this); 93Features.Set<IConnectionHeartbeatFeature>(this); 94Features.Set<ITransferFormatFeature>(this); 95Features.Set<IHttpContextFeature>(this); 96Features.Set<IHttpTransportFeature>(this); 97Features.Set<IConnectionInherentKeepAliveFeature>(this); 98Features.Set<IConnectionLifetimeFeature>(this); 99Features.Set<IConnectionLifetimeNotificationFeature>(this); 104Features.Set<IStatefulReconnectFeature>(this);
Internal\HttpConnectionDispatcher.cs (2)
604connection.Features.Set(context.Features.Get<IHttpConnectionFeature>()); 608connection.Features.Set(context.Features.Get<IConnectionEndPointFeature>());
Microsoft.AspNetCore.HttpLogging (4)
HttpLoggingMiddleware.cs (4)
201context.Features.Set<IHttpUpgradeFeature>(loggableUpgradeFeature); 213context.Features.Set<IHttpResponseBodyFeature>(responseBufferingStream); 278context.Features.Set(originalBodyFeature); 290context.Features.Set(originalUpgradeFeature);
Microsoft.AspNetCore.HttpOverrides (1)
CertificateForwardingMiddleware.cs (1)
52httpContext.Features.Set<ITlsConnectionFeature>(new CertificateForwardingFeature(_logger, header, _options));
Microsoft.AspNetCore.Localization (1)
RequestLocalizationMiddleware.cs (1)
110context.Features.Set<IRequestCultureFeature>(new RequestCultureFeature(requestCulture, winningProvider));
Microsoft.AspNetCore.Mvc.Core (2)
Filters\MiddlewareFilter.cs (1)
35httpContext.Features.Set<IMiddlewareFilterFeature>(feature);
Filters\RequestFormLimitsFilter.cs (1)
40features.Set<IFormFeature>(new FormFeature(context.HttpContext.Request, FormOptions));
Microsoft.AspNetCore.Mvc.RazorPages (1)
Filters\PageViewDataAttributeFilter.cs (1)
27context.HttpContext.Features.Set<IViewDataValuesProviderFeature>(this);
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Filters\ControllerViewDataAttributeFilter.cs (1)
26context.HttpContext.Features.Set<IViewDataValuesProviderFeature>(this);
Microsoft.AspNetCore.OutputCaching (2)
OutputCacheMiddleware.cs (2)
490context.HttpContext.Features.Set<IOutputCacheFeature>(new OutputCacheFeature(context)); 506context.Features.Set<IOutputCacheFeature?>(null);
Microsoft.AspNetCore.ResponseCaching (2)
ResponseCachingMiddleware.cs (2)
435context.Features.Set<IResponseCachingFeature>(new ResponseCachingFeature()); 454context.Features.Set<IResponseCachingFeature?>(null);
Microsoft.AspNetCore.ResponseCompression (4)
ResponseCompressionMiddleware.cs (4)
62context.Features.Set<IHttpResponseBodyFeature>(compressionBody); 63context.Features.Set<IHttpsCompressionFeature>(compressionBody); 72context.Features.Set(originalBodyFeature); 73context.Features.Set(originalCompressionFeature);
Microsoft.AspNetCore.Routing (1)
RouterMiddleware.cs (1)
62httpContext.Features.Set<IRoutingFeature>(routingFeature);
Microsoft.AspNetCore.Server.IISIntegration (3)
IISMiddleware.cs (3)
140httpContext.Features.Set<ITlsConnectionFeature>(new ForwardedTlsConnectionFeature(_logger, header)); 151httpContext.Features.Set(user); 164httpContext.Features.Set<IHttpUpgradeFeature?>(null);
Microsoft.AspNetCore.Server.Kestrel.Core (17)
Internal\Infrastructure\KestrelConnectionOfT.cs (5)
27connectionContext.Features.Set<IConnectionHeartbeatFeature>(this); 28connectionContext.Features.Set<IConnectionCompleteFeature>(this); 29connectionContext.Features.Set<IConnectionLifetimeNotificationFeature>(this); 30connectionContext.Features.Set<IConnectionMetricsContextFeature>(this); 51connectionContext.Features.Set<IConnectionMetricsTagsFeature>(metricsTagsFeature);
Internal\KestrelServerImpl.cs (1)
72Features.Set<IServerAddressesFeature>(_serverAddresses);
Internal\SniOptionsSelector.cs (1)
148connection.Features.Set(new HttpProtocolsFeature(sniOptions.HttpProtocols));
Internal\WebTransport\WebTransportStream.cs (3)
56_features.Set<IStreamDirectionFeature>(this); 57_features.Set<IStreamIdFeature>(this); 58_features.Set<IConnectionItemsFeature>(this);
Middleware\ConnectionLimitMiddleware.cs (1)
47connection.Features.Set<IDecrementConcurrentConnectionCountFeature>(releasor);
Middleware\HttpsConnectionMiddleware.cs (6)
162context.Features.Set<ITlsConnectionFeature>(feature); 163context.Features.Set<ITlsHandshakeFeature>(feature); 164context.Features.Set<ITlsApplicationProtocolFeature>(feature); 165context.Features.Set<ISslStreamFeature>(feature); 166context.Features.Set<SslStream>(sslStream); // Anti-pattern, but retain for back compat 474context.Features.Set(sslStream);
Microsoft.AspNetCore.Session (2)
SessionMiddleware.cs (2)
86context.Features.Set<ISessionFeature>(feature); 94context.Features.Set<ISessionFeature?>(null);
Microsoft.AspNetCore.StaticAssets (2)
Development\StaticAssetDevelopmentRuntimeHandler.cs (2)
70context.Features.Set<IHttpResponseBodyFeature>(new RuntimeStaticAssetResponseBodyFeature(originalFeature, context, asset)); 74context.Features.Set(originalFeature);
Microsoft.AspNetCore.Watch.BrowserRefresh (2)
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserRefreshMiddleware.cs (2)
50context.Features.Set<IHttpResponseBodyFeature>(new StreamResponseBodyFeature(responseStreamWrapper)); 63context.Features.Set(originalBodyFeature);
Microsoft.AspNetCore.WebSockets (1)
WebSocketMiddleware.cs (1)
64context.Features.Set<IHttpWebSocketFeature>(webSocketFeature);
Microsoft.Extensions.Features (1)
FeatureReferences.cs (1)
126Collection.Set(cached);
Microsoft.Extensions.ServiceDiscovery (3)
Configuration\ConfigurationServiceEndpointProvider.cs (2)
197serviceEndpoint.Features.Set<IServiceEndpointProvider>(this); 200serviceEndpoint.Features.Set<IHostNameFeature>(this);
PassThrough\PassThroughServiceEndpointProvider.cs (1)
20ep.Features.Set<IServiceEndpointProvider>(this);
Microsoft.Extensions.ServiceDiscovery.Dns (4)
DnsServiceEndpointProvider.cs (2)
60serviceEndpoint.Features.Set<IServiceEndpointProvider>(this); 63serviceEndpoint.Features.Set<IHostNameFeature>(this);
DnsSrvServiceEndpointProvider.cs (2)
70serviceEndpoint.Features.Set<IServiceEndpointProvider>(this); 73serviceEndpoint.Features.Set<IHostNameFeature>(this);