13 implementations of Get
InMemory.FunctionalTests (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
254TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
Microsoft.AspNetCore.Hosting.Tests (2)
HostingApplicationTests.cs (1)
222public TFeature Get<TFeature>() => Features.Get<TFeature>();
WebHostTests.cs (1)
1326public TFeature Get<TFeature>()
Microsoft.AspNetCore.Owin (1)
OwinFeatureCollection.cs (1)
381public TFeature Get<TFeature>()
Microsoft.AspNetCore.Server.HttpSys (1)
StandardFeatureCollection.cs (1)
106public TFeature? Get<TFeature>()
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpContext.FeatureCollection.cs (1)
316TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\HttpProtocol.Generated.cs (1)
491TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
254TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
254TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
254TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
src\Servers\Kestrel\shared\TransportMultiplexedConnection.Generated.cs (1)
193TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
254TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
Microsoft.Extensions.Features (1)
FeatureCollection.cs (1)
121public TFeature? Get<TFeature>()
873 references to Get
Aspire.Dashboard (3)
Authentication\AspirePolicyEvaluator.cs (1)
82return context.Features.Get<IAuthenticateResultFeature>()?.AuthenticateResult ?? DefaultAuthenticateResult(context);
Authentication\Connection\ConnectionTypeAuthenticationHandler.cs (1)
18var connectionTypeFeature = Context.Features.Get<IConnectionTypeFeature>();
Model\BrowserSecurityHeadersMiddleware.cs (1)
66var feature = context.Features.Get<IConnectionTypeFeature>();
Aspire.Dashboard.Tests (1)
Integration\MockOpenIdAuthority.cs (1)
118var serverAddress = webHost.ServerFeatures.Get<IServerAddressesFeature>();
Aspire.Hosting (1)
Dashboard\DashboardServiceHost.cs (1)
203var addressFeature = _app.Services.GetService<IServer>()?.Features.Get<IServerAddressesFeature>();
BasicWebSite (2)
Controllers\RoutingController.cs (1)
13var endpointFeature = HttpContext.Features.Get<IEndpointFeature>();
Controllers\TempDataController.cs (1)
122HttpContext.Features.Get<ITrackingConsentFeature>().GrantConsent();
Binding.Http.IntegrationTests (1)
MtomBindingTestHelper.cs (1)
54context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 5_368_709_120;
CookiePolicySample (3)
Startup.cs (3)
64context.Features.Get<ITrackingConsentFeature>().GrantConsent(); 67context.Features.Get<ITrackingConsentFeature>().WithdrawConsent(); 98var feature = context.Features.Get<ITrackingConsentFeature>();
ExceptionHandlerSample (1)
Startup.cs (1)
24var error = context.Features.Get<IExceptionHandlerFeature>();
http2cat (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
86var memoryPool = context.Features.Get<IMemoryPoolFeature>()?.MemoryPool;
Http2SampleApp (1)
Program.cs (1)
47var tlsFeature = context.Features.Get<ITlsHandshakeFeature>();
Identity.DefaultUI.WebSite (1)
Pages\Privacy.cshtml.cs (1)
13HttpContext.Features.Get<ITrackingConsentFeature>().GrantConsent();
IIS.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
86var memoryPool = context.Features.Get<IMemoryPoolFeature>()?.MemoryPool;
IIS.LongTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
86var memoryPool = context.Features.Get<IMemoryPoolFeature>()?.MemoryPool;
IIS.NewHandler.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
86var memoryPool = context.Features.Get<IMemoryPoolFeature>()?.MemoryPool;
IIS.NewShim.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
86var memoryPool = context.Features.Get<IMemoryPoolFeature>()?.MemoryPool;
IIS.Tests (8)
ConnectionIdFeatureTests.cs (1)
22var connectionIdFeature = ctx.Features.Get<IHttpConnectionFeature>();
HttpBodyControlFeatureTests.cs (1)
25var bodyControl = ctx.Features.Get<IHttpBodyControlFeature>();
MaxRequestBodySizeTests.cs (4)
74var feature = ctx.Features.Get<IHttpMaxRequestBodySizeFeature>(); 110var feature = ctx.Features.Get<IHttpMaxRequestBodySizeFeature>(); 137var feature = ctx.Features.Get<IHttpMaxRequestBodySizeFeature>(); 248var feature = ctx.Features.Get<IHttpMaxRequestBodySizeFeature>();
TlsHandshakeFeatureTests.cs (2)
23tlsHandshakeFeature = ctx.Features.Get<ITlsHandshakeFeature>(); 67tlsHandshakeFeature = ctx.Features.Get<ITlsHandshakeFeature>();
IISExpress.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
86var memoryPool = context.Features.Get<IMemoryPoolFeature>()?.MemoryPool;
IISSample (1)
Startup.cs (1)
82if (context.Features.Get<IHttpUpgradeFeature>() != null)
InMemory.FunctionalTests (191)
BadHttpRequestTests.cs (1)
335var badRequestFeature = featureCollection.Get<IBadRequestExceptionFeature>();
ConnectionLimitTests.cs (1)
59var feature = context.Features.Get<IHttpUpgradeFeature>();
EventSourceTests.cs (3)
43connectionId = context.Features.Get<IHttpConnectionFeature>().ConnectionId; 46var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 151connectionId = context.Features.Get<IHttpConnectionFeature>().ConnectionId;
Http2\Http2ConnectionTests.cs (9)
331var trailersFeature = context.Features.Get<IHttpResponseTrailersFeature>(); 497var persistentStateCollection = context.Features.Get<IPersistentStateFeature>().State; 1169if (context.Features.Get<IHttp2StreamIdFeature>().StreamId == 1) 1905var streamId = context.Features.Get<IHttp2StreamIdFeature>().StreamId; 3194var streamId = context.Features.Get<IHttp2StreamIdFeature>().StreamId; 3314var streamId = context.Features.Get<IHttp2StreamIdFeature>().StreamId; 4217var streamId = context.Features.Get<IHttp2StreamIdFeature>().StreamId; 4321var streamId = context.Features.Get<IHttp2StreamIdFeature>().StreamId; 4762var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>();
Http2\Http2EndToEndTests.cs (1)
33connectionIdFromFeature = context.Features.Get<IConnectionIdFeature>().ConnectionId;
Http2\Http2StreamTests.cs (36)
362context.Response.Headers["rawtarget"] = context.Features.Get<IHttpRequestFeature>().RawTarget; 407Assert.Equal(input, context.Features.Get<IHttpRequestFeature>().RawTarget); 2051Assert.False(context.Features.Get<IHttpMaxRequestBodySizeFeature>().IsReadOnly); 2052context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 17; 2060Assert.True(context.Features.Get<IHttpMaxRequestBodySizeFeature>().IsReadOnly); 2111Assert.False(context.Features.Get<IHttpMaxRequestBodySizeFeature>().IsReadOnly); 2112context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 12; 2116Assert.True(context.Features.Get<IHttpMaxRequestBodySizeFeature>().IsReadOnly); 2310var trailers = context.Features.Get<IHttpResponseTrailersFeature>().Trailers; 2473Assert.Throws<InvalidOperationException>(() => context.Features.Get<IHttpResponseTrailersFeature>().Trailers.ETag = "Custom 你好 Tag"); 2474Assert.Throws<InvalidOperationException>(() => context.Features.Get<IHttpResponseTrailersFeature>().Trailers.Accept = "Custom 你好 Tag"); 2516context.Features.Get<IHttpResponseTrailersFeature>().Trailers.ETag = "Custom 你好 Tag"; 2517context.Features.Get<IHttpResponseTrailersFeature>().Trailers.Accept = "Custom 你好 Accept"; 3178var streamIdFeature = context.Features.Get<IHttp2StreamIdFeature>(); 3211var streamIdFeature = context.Features.Get<IHttp2StreamIdFeature>(); 3247var streamIdFeature = context.Features.Get<IHttp2StreamIdFeature>(); 3289var streamIdFeature = context.Features.Get<IHttp2StreamIdFeature>(); 3332var streamIdFeature = context.Features.Get<IHttp2StreamIdFeature>(); 3372var streamIdFeature = context.Features.Get<IHttp2StreamIdFeature>(); 3485var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>(); 4748Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 4804Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 4872Assert.False(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 4926Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 4988Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5047Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5168Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5242Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5318Assert.False(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5389Assert.False(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5457Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5539Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5621Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5625var resetFeature = context.Features.Get<IHttpResetFeature>(); 5705Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 5709var resetFeature = context.Features.Get<IHttpResetFeature>();
Http2\Http2TestBase.cs (7)
194_receivedRequestFields.RawTarget = context.Features.Get<IHttpRequestFeature>().RawTarget; 221_receivedRequestFields.RawTarget = context.Features.Get<IHttpRequestFeature>().RawTarget; 227var trailers = context.Features.Get<IHttpRequestTrailersFeature>().Trailers; 292var streamIdFeature = context.Features.Get<IHttp2StreamIdFeature>(); 312var streamIdFeature = context.Features.Get<IHttp2StreamIdFeature>(); 373context.Response.Headers["rawtarget"] = context.Features.Get<IHttpRequestFeature>().RawTarget; 386var resetFeature = context.Features.Get<IHttpResetFeature>();
Http2\Http2TimeoutTests.cs (2)
871context.Features.Get<IHttpMinRequestBodyDataRateFeature>().MinDataRate = null; 927var streamId = context.Features.Get<IHttp2StreamIdFeature>().StreamId;
Http2\Http2WebSocketTests.cs (10)
22var connectFeature = context.Features.Get<IHttpExtendedConnectFeature>(); 81var requestBodyDetectionFeature = context.Features.Get<IHttpRequestBodyDetectionFeature>(); 84var connectFeature = context.Features.Get<IHttpExtendedConnectFeature>(); 160var connectFeature = context.Features.Get<IHttpExtendedConnectFeature>(); 332var connectFeature = context.Features.Get<IHttpExtendedConnectFeature>(); 395var connectFeature = context.Features.Get<IHttpExtendedConnectFeature>(); 396var maxRequestBodySizeFeature = context.Features.Get<IHttpMaxRequestBodySizeFeature>(); 453var connectFeature = context.Features.Get<IHttpExtendedConnectFeature>(); 523var connectFeature = context.Features.Get<IHttpExtendedConnectFeature>(); 596var connectFeature = context.Features.Get<IHttpExtendedConnectFeature>();
Http2\TlsTests.cs (1)
43var tlsFeature = context.Features.Get<ITlsApplicationProtocolFeature>();
Http3\Http3ConnectionTests.cs (5)
326var lifetime = Http3Api.MultiplexedConnectionContext.Features.Get<IConnectionLifetimeNotificationFeature>(); 472var http3Stream1 = (Http3Stream)streamContext1.Features.Get<IPersistentStateFeature>().State[Http3Connection.StreamPersistentStateKey]; 479var http3Stream2 = (Http3Stream)streamContext2.Features.Get<IPersistentStateFeature>().State[Http3Connection.StreamPersistentStateKey]; 566var trailersFeature = context.Features.Get<IHttpResponseTrailersFeature>(); 738var errorCodeFeature = Http3Api.MultiplexedConnectionContext.Features.Get<IProtocolErrorCodeFeature>();
Http3\Http3StreamTests.cs (34)
210context.Response.Headers["rawtarget"] = context.Features.Get<IHttpRequestFeature>().RawTarget; 244Assert.Equal(input, context.Features.Get<IHttpRequestFeature>().RawTarget); 830var trailersFeature = context.Features.Get<IHttpResponseTrailersFeature>(); 860var trailersFeature = context.Features.Get<IHttpResponseTrailersFeature>(); 894var trailersFeature = context.Features.Get<IHttpResponseTrailersFeature>(); 954var trailersFeature = context.Features.Get<IHttpResponseTrailersFeature>(); 986var trailersFeature = context.Features.Get<IHttpResponseTrailersFeature>(); 1017Assert.Throws<InvalidOperationException>(() => context.Features.Get<IHttpResponseTrailersFeature>().Trailers.ETag = "Custom 你好 Tag"); 1018Assert.Throws<InvalidOperationException>(() => context.Features.Get<IHttpResponseTrailersFeature>().Trailers.Accept = "Custom 你好 Tag"); 1048context.Features.Get<IHttpResponseTrailersFeature>().Trailers.ETag = "Custom 你好 Tag"; 1049context.Features.Get<IHttpResponseTrailersFeature>().Trailers.Accept = "Custom 你好 Accept"; 1109var resetFeature = context.Features.Get<IHttpResetFeature>(); 1144Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1193Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1247Assert.False(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1294Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1343Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1395Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1495Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1550Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1607Assert.False(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1665Assert.False(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1720Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1781Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1843Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1847var resetFeature = context.Features.Get<IHttpResetFeature>(); 1908Assert.True(context.Features.Get<IHttpResponseTrailersFeature>().Trailers.IsReadOnly); 1912var resetFeature = context.Features.Get<IHttpResetFeature>(); 2664Assert.False(context.Features.Get<IHttpMaxRequestBodySizeFeature>().IsReadOnly); 2665context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 17; 2673Assert.True(context.Features.Get<IHttpMaxRequestBodySizeFeature>().IsReadOnly); 2716Assert.False(context.Features.Get<IHttpMaxRequestBodySizeFeature>().IsReadOnly); 2717context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 12; 2721Assert.True(context.Features.Get<IHttpMaxRequestBodySizeFeature>().IsReadOnly);
Http3\Http3TestBase.cs (1)
104context.Response.Headers["rawtarget"] = context.Features.Get<IHttpRequestFeature>().RawTarget;
Http3\Http3TimeoutTests.cs (1)
699context.Features.Get<IHttpMinRequestBodyDataRateFeature>().MinDataRate = null;
HttpsConnectionMiddlewareTests.cs (20)
114var feature = context.Features.Get<ISslStreamFeature>(); 145var tlsFeature = context.Features.Get<ITlsHandshakeFeature>(); 183var tlsFeature = context.Features.Get<ITlsHandshakeFeature>(); 232var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 260var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 307Assert.NotNull(connection.Features.Get<SslStream>()); 371Assert.NotNull(connection.Features.Get<SslStream>()); 444Assert.NotNull(connection.Features.Get<SslStream>()); 512var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 548var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 592var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 633var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 640var lifetimeNotificationFeature = context.Features.Get<IConnectionLifetimeNotificationFeature>(); 676var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 724var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 766var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 893var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 1029var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 1076var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 1282var tlsFeature = context.Features.Get<ITlsConnectionFeature>();
HttpsTests.cs (4)
460var sslOptions = bindFeatures.Get<TlsConnectionCallbackOptions>(); 504var tlsOptions = bindFeatures.Get<TlsConnectionCallbackOptions>(); 619var tlsOptions = bindFeatures.Get<TlsConnectionCallbackOptions>(); 669var tlsOptions = bindFeatures.Get<TlsConnectionCallbackOptions>();
KeepAliveTimeoutTests.cs (1)
272using (var stream = await httpContext.Features.Get<IHttpUpgradeFeature>().UpgradeAsync())
KestrelMetricsTests.cs (9)
51connectionContext.Features.Get<IConnectionMetricsTagsFeature>().Tags.Add(new KeyValuePair<string, object>("custom", "value!")); 114hasConnectionMetricsTagsFeature = connectionContext.Features.Get<IConnectionMetricsTagsFeature>() != null; 219getNotificationFeatureTcs.TrySetResult(c.Features.Get<IConnectionLifetimeNotificationFeature>()); 330connectionContext.Features.Get<IConnectionMetricsTagsFeature>().Tags.Add(new KeyValuePair<string, object>("custom", "value!")); 364Assert.NotEqual(overridenFeature, currentConnectionContext.Features.Get<IConnectionMetricsTagsFeature>()); 520var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 539getNotificationFeatureTcs.TrySetResult(context.Features.Get<IConnectionLifetimeNotificationFeature>()); 686connectionId = context.Features.Get<IHttpConnectionFeature>().ConnectionId; 854connectionId = context.Features.Get<IHttpConnectionFeature>().ConnectionId;
MaxRequestBodySizeTests.cs (6)
171var feature = context.Features.Get<IHttpMaxRequestBodySizeFeature>(); 213var feature = context.Features.Get<IHttpMaxRequestBodySizeFeature>(); 293var feature = context.Features.Get<IHttpMaxRequestBodySizeFeature>(); 330var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 333var feature = context.Features.Get<IHttpMaxRequestBodySizeFeature>(); 515var feature = context.Features.Get<IHttpMaxRequestBodySizeFeature>();
RequestBodyTimeoutTests.cs (3)
32context.Features.Get<IHttpMinRequestBodyDataRateFeature>().MinDataRate = 116context.Features.Get<IHttpMinRequestBodyDataRateFeature>().MinDataRate = null; 163context.Features.Get<IHttpMinRequestBodyDataRateFeature>().MinDataRate =
RequestTargetProcessingTests.cs (2)
69Assert.Equal(requestTarget, context.Features.Get<IHttpRequestFeature>().RawTarget); 101Assert.Equal(requestTarget, context.Features.Get<IHttpRequestFeature>().RawTarget);
RequestTests.cs (12)
184var stream = await context.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 239rawTargetTcs.TrySetResult(context.Features.Get<IHttpRequestFeature>().RawTarget); 1308var requestFeature = httpContext.Features.Get<IHttpRequestFeature>(); 1357var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 1599var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 1634context.Features.Get<IHttpMinRequestBodyDataRateFeature>().MinDataRate = 1637using (var stream = await context.Features.Get<IHttpUpgradeFeature>().UpgradeAsync()) 1688var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>(); 1739var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>(); 1787var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>(); 1832var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>(); 2140var persistentStateCollection = context.Features.Get<IPersistentStateFeature>().State;
ResponseDrainingTests.cs (1)
30context.Features.Get<IHttpMinResponseDataRateFeature>().MinDataRate = minRate;
ResponseTests.cs (7)
2377var stream = await httpContext.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 2854var feature = httpContext.Features.Get<IConnectionLifetimeFeature>(); 2887var responseFeature = httpContext.Features.Get<IHttpResponseFeature>(); 3418var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>(); 3448var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>(); 3479var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>(); 3514var bodyControlFeature = context.Features.Get<IHttpBodyControlFeature>();
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
320feature = MultiplexedConnectionFeatures.Get<TFeature>();
TestTransport\RequestExtensions.cs (1)
12return request.HttpContext.Features.Get<IHttpRequestBodyDetectionFeature>()?.CanHaveBody;
UpgradeTests.cs (12)
28var feature = context.Features.Get<IHttpUpgradeFeature>(); 73var feature = context.Features.Get<IHttpUpgradeFeature>(); 123var feature = context.Features.Get<IHttpUpgradeFeature>(); 163var feature = context.Features.Get<IHttpUpgradeFeature>(); 197var feature = context.Features.Get<IHttpUpgradeFeature>(); 232var feature = context.Features.Get<IHttpUpgradeFeature>(); 273var feature = context.Features.Get<IHttpUpgradeFeature>(); 310var feature = context.Features.Get<IHttpUpgradeFeature>(); 358var feature = context.Features.Get<IHttpUpgradeFeature>(); 397var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 404var connectionTransportFeature = context.Features.Get<IConnectionTransportFeature>(); 442await context.Features.Get<IHttpUpgradeFeature>().UpgradeAsync();
InProcessWebSite (19)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (14)
107var serverAddresses = ctx.RequestServices.GetService<IServer>().Features.Get<IServerAddressesFeature>(); 225var feature = ctx.Features.Get<IServerVariablesFeature>(); 302ctx.Features.Get<IHttpRequestFeature>().Headers = headers; 303Assert.Same(headers, ctx.Features.Get<IHttpRequestFeature>().Headers); 336Assert.Null(ctx.Features.Get<IHttpResponseFeature>().ReasonPhrase); 337ctx.Features.Get<IHttpResponseFeature>().ReasonPhrase = "Set Response"; 338Assert.Equal("Set Response", ctx.Features.Get<IHttpResponseFeature>().ReasonPhrase); 342ctx.Features.Get<IHttpResponseFeature>().Headers = headers; 343Assert.Same(headers, ctx.Features.Get<IHttpResponseFeature>().Headers); 392var feature = ctx.Features.Get<IHttpResponseFeature>(); 683var feature = ctx.Features.Get<IHttpBufferingFeature>(); 1051var serverVariableFeature = ctx.Features.Get<IServerVariablesFeature>(); 1074public Task BodyLimit(HttpContext ctx) => ctx.Response.WriteAsync(ctx.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize?.ToString(CultureInfo.InvariantCulture) ?? "null"); 1106context.Response.WriteAsync(context.Features.Get<IHttpUpgradeFeature>() != null ? "Enabled" : "Disabled");
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.WebSockets.cs (5)
29var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 39var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 100var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 144var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 156Assert.Null(context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize);
Interop.FunctionalTests (17)
Http2\Http2RequestTests.cs (1)
100protocolTcs.SetResult(c.Features.Get<ISslStreamFeature>().SslStream.SslProtocol);
Http3\Http3RequestTests.cs (8)
135connectionIdFromFeature = context.Features.Get<IConnectionIdFeature>().ConnectionId; 835var persistentStateCollection = context.Features.Get<IPersistentStateFeature>().State; 1344var feature = context.Features.Get<IHttpResponseTrailersFeature>(); 1531context.Features.Get<IHttpResetFeature>().Reset(256); 1759connectionStartedTcs1.SetResult(context.Features.Get<IConnectionLifetimeNotificationFeature>()); 1762connectionStartedTcs2.SetResult(context.Features.Get<IConnectionLifetimeNotificationFeature>()); 1765connectionStartedTcs3.SetResult(context.Features.Get<IConnectionLifetimeNotificationFeature>()); 2185context.Features.Get<IHttpResetFeature>().Reset(-1);
HttpClientHttp2InteropTests.cs (6)
591context.Features.Get<IHttpResetFeature>().Reset(8); // Cancel 618context.Features.Get<IHttpResetFeature>().Reset(8); // Cancel 646context.Features.Get<IHttpResetFeature>().Reset(8); // Cancel 675context.Features.Get<IHttpResetFeature>().Reset(8); // Cancel 710context.Features.Get<IHttpResetFeature>().Reset(8); // Cancel 769context.Features.Get<IHttpResetFeature>().Reset(8); // Cancel
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (1)
30return host.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>().Addresses
src\Servers\Kestrel\shared\test\TransportTestHelpers\IWebHostPortExtensions.cs (1)
26return host.ServerFeatures.Get<IServerAddressesFeature>().Addresses
Kestrel.SampleApp (5)
ClientCertBufferingFeature.cs (4)
24var tlsFeature = context.Features.Get<ITlsConnectionFeature>(); 25var bodyFeature = context.Features.Get<IHttpRequestBodyDetectionFeature>(); 26var connectionItems = context.Features.Get<IConnectionItemsFeature>(); 71var connectionItems = _context.Features.Get<IConnectionItemsFeature>();
Startup.cs (1)
37context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = 1024;
LocalizationSample (1)
Startup.cs (1)
44var requestCultureFeature = context.Features.Get<IRequestCultureFeature>();
LocalizationWebsite (1)
StartupBuilderAPIs.cs (1)
32var requestCultureFeature = context.Features.Get<IRequestCultureFeature>();
Microsoft.AspNetCore (1)
WebApplication.cs (1)
239var addresses = ServerFeatures.Get<IServerAddressesFeature>()?.Addresses;
Microsoft.AspNetCore.Antiforgery (2)
Internal\DefaultAntiforgery.cs (1)
268var antiforgeryFeature = httpContext.Features.Get<IAntiforgeryFeature>();
src\Shared\HttpExtensions.cs (1)
61var routeValuesFeature = context.Features.Get<IRouteValuesFeature>();
Microsoft.AspNetCore.Antiforgery.Test (1)
AntiforgeryMiddlewareTest.cs (1)
27Assert.True(httpContext.Features.Get<IAntiforgeryValidationFeature>()?.IsValid);
Microsoft.AspNetCore.Authentication (3)
AuthenticationHandler.cs (2)
54protected PathString OriginalPath => Context.Features.Get<IAuthenticationFeature>()?.OriginalPath ?? Request.Path; 59protected PathString OriginalPathBase => Context.Features.Get<IAuthenticationFeature>()?.OriginalPathBase ?? Request.PathBase;
RequestPathBaseCookieBuilder.cs (1)
28var originalPathBase = context.Features.Get<IAuthenticationFeature>()?.OriginalPathBase ?? context.Request.PathBase;
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
490var binding = Context.Features.Get<ITlsTokenBindingFeature>()?.GetProvidedTokenBindingId();
Microsoft.AspNetCore.Authentication.Negotiate (2)
NegotiateHandler.cs (2)
410return Context.Features.Get<IConnectionItemsFeature>()?.Items 416var connectionCompleteFeature = Context.Features.Get<IConnectionCompleteFeature>()
Microsoft.AspNetCore.Authentication.Test (4)
AuthenticationMiddlewareTests.cs (4)
76var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 99var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 119var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 145var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>();
Microsoft.AspNetCore.Authorization.Policy (2)
AuthorizationMiddleware.cs (1)
159if (context.Features.Get<IAuthenticateResultFeature>() is IAuthenticateResultFeature authenticateResultFeature)
PolicyEvaluator.cs (1)
71return context.Features.Get<IAuthenticateResultFeature>()?.AuthenticateResult ?? DefaultAuthenticateResult(context);
Microsoft.AspNetCore.Authorization.Test (7)
AuthorizationMiddlewareTests.cs (7)
785var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 809var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 848var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 872var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 898var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 940var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 966var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>();
Microsoft.AspNetCore.Components.Endpoints (4)
RazorComponentEndpointInvoker.cs (3)
41var isErrorHandler = context.Features.Get<IExceptionHandlerFeature>() is not null; 166context.Features.Get<IExceptionHandlerFeature>() == null; 188if (context.Features.Get<IAntiforgeryValidationFeature>() is { } antiForgeryValidationFeature)
Results\RazorComponentResultExecutor.cs (1)
50var isErrorHandler = httpContext.Features.Get<IExceptionHandlerFeature>() is not null;
Microsoft.AspNetCore.Components.Server (1)
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
96var currentFeature = ctx.Features.Get<IHttpWebSocketFeature>();
Microsoft.AspNetCore.Connections.Abstractions (1)
ConnectionContext.cs (1)
29Features.Get<IConnectionLifetimeFeature>()?.Abort();
Microsoft.AspNetCore.CookiePolicy (1)
CookiePolicyMiddleware.cs (1)
65var feature = context.Features.Get<IResponseCookiesFeature>() ?? new ResponseCookiesFeature(context.Features);
Microsoft.AspNetCore.CookiePolicy.Test (21)
CookieConsentTests.cs (21)
23var feature = context.Features.Get<ITrackingConsentFeature>(); 42var feature = context.Features.Get<ITrackingConsentFeature>(); 61var feature = context.Features.Get<ITrackingConsentFeature>(); 87var feature = context.Features.Get<ITrackingConsentFeature>(); 106var feature = context.Features.Get<ITrackingConsentFeature>(); 136var feature = context.Features.Get<ITrackingConsentFeature>(); 159var feature = context.Features.Get<ITrackingConsentFeature>(); 182var feature = context.Features.Get<ITrackingConsentFeature>(); 202var feature = context.Features.Get<ITrackingConsentFeature>(); 253var feature = context.Features.Get<ITrackingConsentFeature>(); 290var feature = context.Features.Get<ITrackingConsentFeature>(); 318var feature = context.Features.Get<ITrackingConsentFeature>(); 351var feature = context.Features.Get<ITrackingConsentFeature>(); 382var feature = context.Features.Get<ITrackingConsentFeature>(); 431var feature = context.Features.Get<ITrackingConsentFeature>(); 467var feature = context.Features.Get<ITrackingConsentFeature>(); 502var feature = context.Features.Get<ITrackingConsentFeature>(); 536var feature = context.Features.Get<ITrackingConsentFeature>(); 557var feature = context.Features.Get<ITrackingConsentFeature>(); 610var feature = context.Features.Get<ITrackingConsentFeature>(); 655var feature = context.Features.Get<ITrackingConsentFeature>();
Microsoft.AspNetCore.Diagnostics (6)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (2)
93RouteValues = httpContext.Features.Get<IRouteValuesFeature>()?.RouteValues 268routeValues: httpContext.Features.Get<IRouteValuesFeature>()?.RouteValues
DiagnosticsTelemetry.cs (1)
16if (context.Features.Get<IHttpMetricsTagsFeature>() is { } tagsFeature)
ExceptionHandler\ExceptionHandlerMiddlewareImpl.cs (1)
161RouteValues = context.Features.Get<IRouteValuesFeature>()?.RouteValues
src\Shared\HttpExtensions.cs (1)
61var routeValuesFeature = context.Features.Get<IRouteValuesFeature>();
StatusCodePage\StatusCodePagesExtensions.cs (1)
178var routeValuesFeature = context.HttpContext.Features.Get<IRouteValuesFeature>();
Microsoft.AspNetCore.Diagnostics.Tests (6)
DeveloperExceptionPageMiddlewareTest.cs (2)
86var feature = context.HttpContext.Features.Get<IExceptionHandlerFeature>(); 145var feature = context.HttpContext.Features.Get<IExceptionHandlerPathFeature>();
ExceptionHandlerMiddlewareTest.cs (1)
113var feature = context.Features.Get<IExceptionHandlerPathFeature>();
StatusCodeMiddlewareTest.cs (3)
106var statusCodeReExecuteFeature = httpContext.Features.Get<IStatusCodeReExecuteFeature>(); 168var statusCodeReExecuteFeature = httpContext.Features.Get<IStatusCodeReExecuteFeature>(); 224var statusCodeReExecuteFeature = httpContext.Features.Get<IStatusCodeReExecuteFeature>();
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
UnaryServerCallHandlerTests.cs (1)
1585feature = c.GetHttpContext().Features.Get<IServerCallContextFeature>();
Microsoft.AspNetCore.HeaderParsing (1)
HeaderParsingHttpRequestExtensions.cs (1)
25var feature = context.Features.Get<HeaderParsingFeature>();
Microsoft.AspNetCore.Hosting (4)
GenericHost\GenericWebHostService.cs (1)
66var serverAddressesFeature = Server.Features.Get<IServerAddressesFeature>();
Internal\WebHost.cs (1)
261var serverAddressesFeature = Server.Features?.Get<IServerAddressesFeature>();
src\Shared\HttpExtensions.cs (1)
61var routeValuesFeature = context.Features.Get<IRouteValuesFeature>();
WebHostExtensions.cs (1)
122var serverAddresses = host.ServerFeatures.Get<IServerAddressesFeature>()?.Addresses;
Microsoft.AspNetCore.Hosting.Tests (11)
HostingApplicationTests.cs (1)
222public TFeature Get<TFeature>() => Features.Get<TFeature>();
HostingMetricsTests.cs (1)
174var contextFeature = httpContext.Features.Get<IHttpMetricsTagsFeature>();
WebHostTests.cs (9)
43var serverAddressesFeature = host.ServerFeatures.Get<IServerAddressesFeature>(); 62var serverAddressFeature = host.ServerFeatures.Get<IServerAddressesFeature>(); 81var serverAddressFeature = host.ServerFeatures.Get<IServerAddressesFeature>(); 101var serverAddressFeature = host.ServerFeatures.Get<IServerAddressesFeature>(); 113var serverAddressesFeature = host.ServerFeatures.Get<IServerAddressesFeature>(); 132Assert.True(host.ServerFeatures.Get<IServerAddressesFeature>().PreferHostingUrls); 879var featuresTraceIdentifier = httpContext.Features.Get<IHttpRequestIdentifierFeature>().TraceIdentifier; 902Assert.Same(requestIdentifierFeature, httpContext.Features.Get<IHttpRequestIdentifierFeature>()); 961Assert.Throws<ObjectDisposedException>(() => capturedContext.Features.Get<IHttpRequestIdentifierFeature>());
Microsoft.AspNetCore.Http (6)
Features\FormFeature.cs (1)
364var hasInvalidToken = _request.HttpContext.Features.Get<IAntiforgeryValidationFeature>() is { IsValid: false };
Internal\DefaultConnectionInfo.cs (1)
16private static readonly Func<IFeatureCollection, IConnectionLifetimeNotificationFeature> _newConnectionLifetime = f => new DefaultConnectionLifetimeNotificationFeature(f.Get<IHttpResponseFeature>());
Internal\ResponseCookies.cs (2)
53var services = _features.Get<IServiceProvidersFeature>()?.RequestServices; 77var services = _features.Get<IServiceProvidersFeature>()?.RequestServices;
RequestFormReaderExtensions.cs (1)
33var formFeature = features.Get<IFormFeature>();
src\Shared\Debugger\HttpContextDebugFormatter.cs (1)
86return response.HttpContext.Features.Get<IHttpResponseFeature>()?.ReasonPhrase ?? reasonPhrase;
Microsoft.AspNetCore.Http.Abstractions.Tests (4)
EndpointHttpContextExtensionsTests.cs (4)
68Assert.Null(context.Features.Get<IEndpointFeature>()); 82var feature = context.Features.Get<IEndpointFeature>(); 104var feature = context.Features.Get<IEndpointFeature>(); 125var feature = context.Features.Get<IEndpointFeature>();
Microsoft.AspNetCore.Http.Connections (8)
HttpConnectionContextExtensions.cs (1)
25return connection.Features.Get<IHttpContextFeature>()?.HttpContext;
Internal\HttpConnectionContext.cs (1)
426context.Features.Get<IHttpRequestTimeoutFeature>()?.DisableTimeout();
Internal\HttpConnectionDispatcher.cs (6)
124context.Features.Get<IHttpActivityFeature>()?.Activity.AddTag("http.long_running", "true"); 243context.Features.Get<IHttpRequestTimeoutFeature>()?.DisableTimeout(); 444return features.Get<IHttpWebSocketFeature>() != null; 603connection.Features.Set(context.Features.Get<IHttpConnectionFeature>()); 664var authenticateResultFeature = context.Features.Get<IAuthenticateResultFeature>(); 733var existingConnectionFeature = context.Features.Get<IHttpConnectionFeature>();
Microsoft.AspNetCore.Http.Connections.Tests (28)
HttpConnectionDispatcherTests.cs (27)
491var ws = (TestWebSocketConnectionFeature)context.Features.Get<IHttpWebSocketFeature>(); 834var endpointFeature = connectionHttpContext.Features.Get<IEndpointFeature>(); 1462var ws = (TestWebSocketConnectionFeature)context1.Features.Get<IHttpWebSocketFeature>(); 1817var transferFormatFeature = connection.Features.Get<ITransferFormatFeature>(); 2002Assert.True(connection.Features.Get<IConnectionInherentKeepAliveFeature>().HasInherentKeepAlive); 2307Assert.Null(connection.Features.Get<IStatefulReconnectFeature>()); 2336Assert.Null(connection.Features.Get<IStatefulReconnectFeature>()); 2365Assert.NotNull(connection.Features.Get<IStatefulReconnectFeature>()); 2395var reconnectFeature = connection.Features.Get<IStatefulReconnectFeature>(); 2402var websocketFeature = (TestWebSocketConnectionFeature)context.Features.Get<IHttpWebSocketFeature>(); 2434websocketFeature = (TestWebSocketConnectionFeature)context.Features.Get<IHttpWebSocketFeature>(); 2469var reconnectFeature = connection.Features.Get<IStatefulReconnectFeature>(); 2476var websocketFeature = (TestWebSocketConnectionFeature)context.Features.Get<IHttpWebSocketFeature>(); 2861var websocket = (TestWebSocketConnectionFeature)context.Features.Get<IHttpWebSocketFeature>(); 3252var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3315var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3414var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3464var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3522Assert.True(((HttpRequestTimeoutFeature)c.Features.Get<IHttpRequestTimeoutFeature>()).Enabled); 3538var url = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single(); 3556var feature = Assert.IsType<HttpRequestTimeoutFeature>(context.Features.Get<IHttpContextFeature>()?.HttpContext.Features.Get<IHttpRequestTimeoutFeature>()); 3580Assert.True(((HttpRequestTimeoutFeature)context.Features.Get<IHttpRequestTimeoutFeature>()).Enabled); 3584Assert.False(((HttpRequestTimeoutFeature)context.Features.Get<IHttpRequestTimeoutFeature>()).Enabled); 3587Assert.True(((HttpRequestTimeoutFeature)context.Features.Get<IHttpRequestTimeoutFeature>()).Enabled); 3590Assert.False(((HttpRequestTimeoutFeature)context.Features.Get<IHttpRequestTimeoutFeature>()).Enabled); 4000var reconnectFeature = connection.Features.Get<IStatefulReconnectFeature>();
MapConnectionHandlerTests.cs (1)
396var feature = host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>();
Microsoft.AspNetCore.Http.Extensions (4)
HttpContextServerVariableExtensions.cs (1)
27var feature = context.Features.Get<IServerVariablesFeature>();
RequestDelegateFactory.cs (3)
1383var feature = httpContext.Features.Get<IHttpRequestBodyDetectionFeature>(); 1502var feature = httpContext.Features.Get<IHttpRequestBodyDetectionFeature>(); 1511if (httpContext.Features.Get<IAntiforgeryValidationFeature>() is { IsValid: false } antiforgeryValidationFeature)
Microsoft.AspNetCore.Http.Tests (24)
DefaultHttpContextTests.cs (6)
111Assert.Null(context.Features.Get<IItemsFeature>()); 113Assert.NotNull(context.Features.Get<IItemsFeature>()); 125Assert.Null(context.Features.Get<IHttpRequestIdentifierFeature>()); 127Assert.NotNull(context.Features.Get<IHttpRequestIdentifierFeature>()); 139Assert.Null(context.Features.Get<IItemsFeature>()); 142Assert.NotNull(context.Features.Get<IItemsFeature>());
Features\FormFeatureTests.cs (9)
72formFeature = context.Features.Get<IFormFeature>(); 109formFeature = context.Features.Get<IFormFeature>(); 216formFeature = context.Features.Get<IFormFeature>(); 251formFeature = context.Features.Get<IFormFeature>(); 288formFeature = context.Features.Get<IFormFeature>(); 336formFeature = context.Features.Get<IFormFeature>(); 373formFeature = context.Features.Get<IFormFeature>(); 421formFeature = context.Features.Get<IFormFeature>(); 570formFeature = context.Features.Get<IFormFeature>();
Internal\DefaultHttpRequestTests.cs (4)
138var requestFeature = request.HttpContext.Features.Get<IHttpRequestFeature>(); 202var routeValuesFeature = context.Features.Get<IRouteValuesFeature>(); 213routeValuesFeature = context.Features.Get<IRouteValuesFeature>(); 349context.Features.Get<IHttpRequestFeature>().Headers = headers;
Internal\DefaultHttpResponseTests.cs (4)
86Assert.Same(responseBodyMock.Object, context.Features.Get<IHttpResponseBodyFeature>()); 91Assert.NotSame(responseBodyMock.Object, context.Features.Get<IHttpResponseBodyFeature>()); 96Assert.Same(responseBodyMock.Object, context.Features.Get<IHttpResponseBodyFeature>()); 241context.Features.Get<IHttpResponseFeature>().Headers = headers;
Timeouts\RequestTimeoutsMiddlewareTests.cs (1)
325var timeoutFeature = context.Features.Get<IHttpRequestTimeoutFeature>();
Microsoft.AspNetCore.HttpLogging (2)
HttpLoggingMiddleware.cs (2)
190originalUpgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 204originalBodyFeature = context.Features.Get<IHttpResponseBodyFeature>()!;
Microsoft.AspNetCore.HttpLogging.Tests (7)
HttpLoggingMiddlewareTests.cs (7)
1220await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1270await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1324await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1367await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1448await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1479upgradeFeature = c.Features.Get<IHttpUpgradeFeature>(); 1491Assert.False(httpContext.Features.Get<IHttpUpgradeFeature>() is UpgradeFeatureLoggingDecorator);
Microsoft.AspNetCore.HttpsPolicy (1)
HttpsRedirectionBuilderExtensions.cs (1)
23var serverAddressFeature = app.ServerFeatures.Get<IServerAddressesFeature>();
Microsoft.AspNetCore.HttpsPolicy.Tests (6)
HttpsRedirectionMiddlewareTests.cs (6)
217server.Features.Get<IServerAddressesFeature>().Addresses.Add(serverAddressFeatureUrl); 260server.Features.Get<IServerAddressesFeature>().Addresses.Add("https://localhost:5050"); 303server.Features.Get<IServerAddressesFeature>().Addresses.Add("https://localhost:5050"); 304server.Features.Get<IServerAddressesFeature>().Addresses.Add("https://localhost:5051"); 345server.Features.Get<IServerAddressesFeature>().Addresses.Add("https://localhost:5050"); 346server.Features.Get<IServerAddressesFeature>().Addresses.Add("https://example.com:5050");
Microsoft.AspNetCore.Localization.Routing.Tests (3)
RouteDataRequestCultureProviderTest.cs (3)
65var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 116var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 186var requestCultureFeature = context.Features.Get<IRequestCultureFeature>();
Microsoft.AspNetCore.Localization.Tests (17)
AcceptLanguageHeaderRequestCultureProviderTest.cs (4)
36var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 77var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 117var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 161var requestCultureFeature = context.Features.Get<IRequestCultureFeature>();
CookieRequestCultureProviderTest.cs (3)
50var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 102var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 151var requestCultureFeature = context.Features.Get<IRequestCultureFeature>();
CustomRequestCultureProviderTest.cs (1)
47var requestCultureFeature = context.Features.Get<IRequestCultureFeature>();
QueryStringRequestCultureProviderTest.cs (8)
39var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 73var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 115var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 156var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 197var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 239var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 286var requestCultureFeature = context.Features.Get<IRequestCultureFeature>(); 334var requestCultureFeature = context.Features.Get<IRequestCultureFeature>();
RequestLocalizationMiddlewareTest.cs (1)
51var requestCulture = context.Features.Get<IRequestCultureFeature>();
Microsoft.AspNetCore.Mvc.Core (9)
Filters\DisableRequestSizeLimitFilter.cs (1)
43var maxRequestBodySizeFeature = context.HttpContext.Features.Get<IHttpMaxRequestBodySizeFeature>();
Filters\OutputCacheFilter.cs (1)
39var outputCachingFeature = context.HttpContext.Features.Get<IOutputCacheFeature>();
Filters\RequestFormLimitsFilter.cs (1)
35var formFeature = features.Get<IFormFeature>();
Filters\RequestSizeLimitFilter.cs (1)
45var maxRequestBodySizeFeature = context.HttpContext.Features.Get<IHttpMaxRequestBodySizeFeature>();
Filters\ResponseCacheFilterExecutor.cs (1)
83var responseCachingFeature = context.HttpContext.Features.Get<IResponseCachingFeature>();
Formatters\InputFormatter.cs (1)
96var canHaveBody = context.HttpContext.Features.Get<IHttpRequestBodyDetectionFeature>()?.CanHaveBody;
ModelBinding\Binders\BodyModelBinder.cs (1)
135var hasBody = httpContext.Features.Get<IHttpRequestBodyDetectionFeature>()?.CanHaveBody;
Routing\ControllerLinkGeneratorExtensions.cs (1)
222return httpContext?.Features?.Get<IRouteValuesFeature>()?.RouteValues;
Routing\PageLinkGeneratorExtensions.cs (1)
222return httpContext?.Features.Get<IRouteValuesFeature>()?.RouteValues;
Microsoft.AspNetCore.Mvc.Core.Test (5)
Filters\MiddlewareFilterTest.cs (1)
40var feature = resourceExecutingContext.HttpContext.Features.Get<IMiddlewareFilterFeature>();
Filters\RequestFormLimitsFilterTest.cs (2)
31var formFeature = authorizationFilterContext.HttpContext.Features.Get<IFormFeature>(); 51var actualFormFeature = authorizationFilterContext.HttpContext.Features.Get<IFormFeature>();
Filters\ResponseCacheFilterExecutorTest.cs (1)
408Assert.Equal(varyOutput, context.HttpContext.Features.Get<IResponseCachingFeature>().VaryByQueryKeys);
ResponseCacheAttributeTest.cs (1)
227Assert.Equal(varyByQueryKeys, context.HttpContext.Features.Get<IResponseCachingFeature>().VaryByQueryKeys);
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
AntiforgeryMiddlewareTest.cs (1)
111context.Request.Body = new SizeLimitedStream(context.Request.Body, context.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize);
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\PageResultExecutor.cs (1)
99var viewDataValuesProvider = pageContext.HttpContext.Features.Get<IViewDataValuesProviderFeature>();
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
Filters\AntiforgeryMiddlewareAuthorizationFilter.cs (1)
21var antiforgeryValidationFeature = context.HttpContext.Features.Get<IAntiforgeryValidationFeature>();
SkipStatusCodePagesAttribute.cs (1)
26var statusCodeFeature = context.HttpContext.Features.Get<IStatusCodePagesFeature>();
ViewComponentResultExecutor.cs (1)
138var viewDataValuesProvider = viewContext.HttpContext.Features.Get<IViewDataValuesProviderFeature>();
ViewExecutor.cs (1)
235var viewDataValuesProvider = viewContext.HttpContext.Features.Get<IViewDataValuesProviderFeature>();
Microsoft.AspNetCore.OutputCaching.Tests (1)
TestUtils.cs (1)
71var feature = context.Features.Get<IHttpBodyControlFeature>();
Microsoft.AspNetCore.Owin (5)
OwinEnvironment.cs (3)
40if (context.Features.Get<IHttpRequestFeature>() == null) 44if (context.Features.Get<IHttpResponseFeature>() == null) 104if (context.Features.Get<IHttpRequestLifetimeFeature>() != null)
OwinExtensions.cs (2)
47var owinEnvFeature = httpContext.Features.Get<IOwinEnvironmentFeature>(); 129return next(httpContext.Features.Get<IOwinEnvironmentFeature>().Environment);
Microsoft.AspNetCore.RequestDecompression (1)
RequestDecompressionMiddleware.cs (1)
63?? context.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize;
Microsoft.AspNetCore.ResponseCaching (2)
ResponseCachingMiddleware.cs (2)
257var varyQueryKeys = new StringValues(context.HttpContext.Features.Get<IResponseCachingFeature>()?.VaryByQueryKeys); 394if (context.Features.Get<IResponseCachingFeature>() != null)
Microsoft.AspNetCore.ResponseCaching.Tests (10)
ResponseCachingMiddlewareTests.cs (1)
908responseCachingFeatureAdded = httpContext.Features.Get<IResponseCachingFeature>() != null;
ResponseCachingTests.cs (8)
316var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "query" }); 338var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "QueryA", "queryb" }); 360var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "*" }); 382var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "QueryB", "QueryA" }); 404var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "*" }); 426var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "query" }); 448var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "QueryA", "QueryB" }); 470var builders = TestUtils.CreateBuildersWithResponseCaching(contextAction: context => context.Features.Get<IResponseCachingFeature>().VaryByQueryKeys = new[] { "*" });
TestUtils.cs (1)
96var feature = context.Features.Get<IHttpBodyControlFeature>();
Microsoft.AspNetCore.ResponseCompression (3)
ResponseCompressionMiddleware.cs (2)
48var originalBodyFeature = context.Features.Get<IHttpResponseBodyFeature>(); 49var originalCompressionFeature = context.Features.Get<IHttpsCompressionFeature>();
ResponseCompressionProvider.cs (1)
165var httpsMode = context.Features.Get<IHttpsCompressionFeature>()?.Mode ?? HttpsCompressionMode.Default;
Microsoft.AspNetCore.ResponseCompression.Tests (13)
ResponseCompressionMiddlewareTest.cs (13)
522var feature = context.Features.Get<IHttpsCompressionFeature>(); 585var feature = context.Features.Get<IHttpsCompressionFeature>(); 729var feature = context.Features.Get<IHttpBodyControlFeature>(); 850context.Features.Get<IHttpResponseBodyFeature>().DisableBuffering(); 852var feature = context.Features.Get<IHttpBodyControlFeature>(); 920context.Features.Get<IHttpResponseBodyFeature>().DisableBuffering(); 984context.Features.Get<IHttpResponseBodyFeature>().DisableBuffering(); 1040fakeSendFile = new FakeSendFileFeature(context.Features.Get<IHttpResponseBodyFeature>()); 1050var sendFile = context.Features.Get<IHttpResponseBodyFeature>(); 1090fakeSendFile = new FakeSendFileFeature(context.Features.Get<IHttpResponseBodyFeature>()); 1100var sendFile = context.Features.Get<IHttpResponseBodyFeature>(); 1140fakeSendFile = new FakeSendFileFeature(context.Features.Get<IHttpResponseBodyFeature>()); 1149var feature = context.Features.Get<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.Rewrite (3)
PatternSegments\ServerProtocolSegment.cs (1)
12return context.HttpContext.Features.Get<IHttpRequestFeature>()?.Protocol;
RewriteMiddleware.cs (1)
80var routeValuesFeature = context.Features.Get<IRouteValuesFeature>();
UrlActions\CustomResponseAction.cs (1)
34var feature = context.HttpContext.Features.Get<IHttpBodyControlFeature>();
Microsoft.AspNetCore.Routing (3)
DefaultLinkGenerator.cs (1)
319return httpContext?.Features.Get<IRouteValuesFeature>()?.RouteValues;
EndpointRoutingMiddleware.cs (1)
311var maxRequestBodySizeFeature = context.Features.Get<IHttpMaxRequestBodySizeFeature>();
src\Shared\HttpExtensions.cs (1)
61var routeValuesFeature = context.Features.Get<IRouteValuesFeature>();
Microsoft.AspNetCore.Routing.Abstractions (2)
RoutingHttpContextExtensions.cs (2)
25var routingFeature = httpContext.Features.Get<IRoutingFeature>(); 41return httpContext.Features.Get<IRouteValuesFeature>()?.RouteValues[key];
Microsoft.AspNetCore.Routing.FunctionalTests (2)
MinimalFormTests.cs (2)
377var form = context.Features.Get<IFormFeature>()?.ReadForm(); 451context.Request.Body = new SizeLimitedStream(context.Request.Body, context.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize);
Microsoft.AspNetCore.Routing.Tests (10)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (3)
72Assert.Null(httpContext.Features.Get<IEndpointFeature>()); 104var feature = httpContext.Features.Get<IEndpointFeature>(); 168Assert.Null(httpContext.Features.Get<IEndpointFeature>());
EndpointRoutingMiddlewareFormOptionsTest.cs (5)
46var formFeature = httpContext.Features.Get<IFormFeature>(); 80var formFeature = httpContext.Features.Get<IFormFeature>(); 118var formFeature = httpContext.Features.Get<IFormFeature>(); 154var formFeature = httpContext.Features.Get<IFormFeature>(); 185var formFeature = httpContext.Features.Get<IFormFeature>();
RouterMiddlewareTest.cs (2)
35var routingFeature = context.Features.Get<IRoutingFeature>(); 38Assert.NotNull(context.Features.Get<IRouteValuesFeature>());
Microsoft.AspNetCore.Server.HttpSys (1)
AuthenticationHandler.cs (1)
39_requestContext = context.Features.Get<RequestContext>();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (120)
DelegateTests.cs (14)
53var delegateFeature = httpContext.Features.Get<IHttpSysRequestDelegationFeature>(); 58var delegationProperty = delegator.Features.Get<IServerDelegationFeature>(); 86var delegateFeature = httpContext.Features.Get<IHttpSysRequestDelegationFeature>(); 91var delegationProperty = delegator.Features.Get<IServerDelegationFeature>(); 117var delegateFeature = httpContext.Features.Get<IHttpSysRequestDelegationFeature>(); 124var delegationProperty = delegator.Features.Get<IServerDelegationFeature>(); 153var delegateFeature = httpContext.Features.Get<IHttpSysRequestDelegationFeature>(); 157var delegationProperty = delegator.Features.Get<IServerDelegationFeature>(); 173var delegateFeature = httpContext.Features.Get<IHttpSysRequestDelegationFeature>(); 178var delegationProperty = delegator.Features.Get<IServerDelegationFeature>(); 202var delegateFeature = httpContext.Features.Get<IHttpSysRequestDelegationFeature>(); 207var delegationProperty = delegator.Features.Get<IServerDelegationFeature>(); 235var delegateFeature = httpContext.Features.Get<IHttpSysRequestDelegationFeature>(); 240var delegationProperty = delegator.Features.Get<IServerDelegationFeature>();
Http2Tests.cs (10)
35var feature = httpContext.Features.Get<IHttpUpgradeFeature>(); 617var feature = httpContext.Features.Get<IHttpResetFeature>(); 639var feature = httpContext.Features.Get<IHttpResetFeature>(); 662var feature = httpContext.Features.Get<IHttpResetFeature>(); 704var feature = httpContext.Features.Get<IHttpResetFeature>(); 751var feature = httpContext.Features.Get<IHttpResetFeature>(); 801var feature = httpContext.Features.Get<IHttpResetFeature>(); 853var feature = httpContext.Features.Get<IHttpResetFeature>(); 899var feature = httpContext.Features.Get<IHttpResetFeature>(); 948var feature = httpContext.Features.Get<IHttpResetFeature>();
Http3Tests.cs (2)
163httpContext.Features.Get<IHttpResetFeature>().Reset(0x010b); // H3_REQUEST_REJECTED 193httpContext.Features.Get<IHttpResetFeature>().Reset(0x010c); // H3_REQUEST_CANCELLED
HttpsTests.cs (7)
81var tls = httpContext.Features.Get<ITlsConnectionFeature>(); 106var tls = httpContext.Features.Get<ITlsConnectionFeature>(); 136var tlsFeature = httpContext.Features.Get<ITlsHandshakeFeature>(); 156var tlsFeature = httpContext.Features.Get<ITlsHandshakeFeature>(); 202var tlsFeature = httpContext.Features.Get<ITlsHandshakeFeature>(); 203var requestInfoFeature = httpContext.Features.Get<IHttpSysRequestInfoFeature>(); 242var requestTimingFeature = httpContext.Features.Get<IHttpSysRequestTimingFeature>();
OpaqueUpgradeTests.cs (11)
29var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 56var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 87var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 113var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 134var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 140var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 173var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 220var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 262var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 285var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 312var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>();
RequestBodyLimitTests.cs (21)
25httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 26var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 48var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 70var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 92httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 93var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 115var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 137var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 159httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 160var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 185var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 210var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 235httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 236var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 261var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 285var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 312httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 313var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 339var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 363var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>(); 387var feature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>();
RequestBodyTests.cs (4)
31httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 51httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 127httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 151httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true;
RequestHeaderTests.cs (3)
109var request = httpContext.Features.Get<RequestContext>().Request; 132var request = httpContext.Features.Get<RequestContext>().Request; 155var request = httpContext.Features.Get<RequestContext>().Request;
RequestTests.cs (20)
28var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 42var connectionInfo = httpContext.Features.Get<IHttpConnectionFeature>(); 50var requestIdentifierFeature = httpContext.Features.Get<IHttpRequestIdentifierFeature>(); 77var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 100var connectionInfo = httpContext.Features.Get<IHttpConnectionFeature>(); 113var requestIdentifierFeature = httpContext.Features.Get<IHttpRequestIdentifierFeature>(); 141var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 163var connectionInfo = httpContext.Features.Get<IHttpConnectionFeature>(); 176var requestIdentifierFeature = httpContext.Features.Get<IHttpRequestIdentifierFeature>(); 212var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 213var connectionInfo = httpContext.Features.Get<IHttpConnectionFeature>(); 214var requestIdentifierFeature = httpContext.Features.Get<IHttpRequestIdentifierFeature>(); 246var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 263var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 312var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 313var requestIdentifierFeature = httpContext.Features.Get<IHttpRequestIdentifierFeature>(); 351var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 408var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 432var requestInfo = httpContext.Features.Get<IHttpRequestFeature>(); 453var requestInfo = httpContext.Features.Get<IHttpRequestFeature>();
ResponseBodyTests.cs (6)
114httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 143httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 170httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 214httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 288httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true; 322httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true;
ResponseHeaderTests.cs (6)
46var responseInfo = httpContext.Features.Get<IHttpResponseFeature>(); 72var responseInfo = httpContext.Features.Get<IHttpResponseFeature>(); 97var responseInfo = httpContext.Features.Get<IHttpResponseFeature>(); 122var responseInfo = httpContext.Features.Get<IHttpResponseFeature>(); 143var responseInfo = httpContext.Features.Get<IHttpResponseFeature>(); 219httpContext.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true;
ResponseSendFileTests.cs (13)
42var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 67var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 86var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 105var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 124var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 144var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 164var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 183var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 201var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 220var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 241var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 262var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 290var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>();
ResponseTests.cs (1)
67httpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = "CustomReasonPhrase"; // TODO?
src\Shared\Http2cat\Http2CatHostedService.cs (1)
86var memoryPool = context.Features.Get<IMemoryPoolFeature>()?.MemoryPool;
Utilities.cs (1)
174return request.HttpContext.Features.Get<IHttpRequestBodyDetectionFeature>()?.CanHaveBody;
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (2)
DelegateOutOfProcTests.cs (2)
55var delegateFeature = httpContext.Features.Get<IHttpSysRequestDelegationFeature>(); 60var delegationProperty = delegator.Features.Get<IServerDelegationFeature>();
Microsoft.AspNetCore.Server.IISIntegration (2)
AuthenticationHandler.cs (1)
52_user = context.Features.Get<WindowsPrincipal>(); // See IISMiddleware
IISMiddleware.cs (1)
128var bodySizeFeature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>();
Microsoft.AspNetCore.Server.IISIntegration.Tests (2)
IISMiddlewareTests.cs (2)
40var auth = context.Features.Get<IHttpAuthenticationFeature>(); 78var auth = context.Features.Get<IHttpAuthenticationFeature>();
Microsoft.AspNetCore.Server.Kestrel.Core (26)
Internal\Http\Http1Connection.cs (1)
849if (ConnectionFeatures.Get<ITlsHandshakeFeature>() == null)
Internal\Http\HttpProtocol.FeatureCollection.cs (1)
281ConnectionFeatures.Get<IDecrementConcurrentConnectionCountFeature>()?.ReleaseConnection();
Internal\Http\HttpProtocol.Generated.cs (1)
645feature = ConnectionFeatures.Get<TFeature>();
Internal\Http2\Http2Connection.cs (4)
160_metricsTagsFeature = context.ConnectionFeatures.Get<IConnectionMetricsTagsFeature>(); 504var tlsFeature = ConnectionFeatures.Get<ITlsHandshakeFeature>(); 546if (ConnectionFeatures.Get<ITlsHandshakeFeature>() != null) 1111_context.ConnectionFeatures.Get<IConnectionLifetimeNotificationFeature>()?.RequestClose();
Internal\Http3\Http3Connection.cs (3)
381var streamDirectionFeature = streamContext.Features.Get<IStreamDirectionFeature>(); 382var streamIdFeature = streamContext.Features.Get<IStreamIdFeature>(); 598var persistentStateFeature = streamContext.Features.Get<IPersistentStateFeature>();
Internal\Http3\Http3ControlStream.cs (1)
391_context.ConnectionContext.Features.Get<IConnectionLifetimeNotificationFeature>()?.RequestClose();
Internal\HttpConnection.cs (6)
59connectionMetricsTagsFeature = _context.ConnectionFeatures.Get<IConnectionMetricsTagsFeature>(); 100var connectionHeartbeatFeature = _context.ConnectionFeatures.Get<IConnectionHeartbeatFeature>(); 101var connectionLifetimeNotificationFeature = _context.ConnectionFeatures.Get<IConnectionLifetimeNotificationFeature>(); 138if (_context.ConnectionContext.Features.Get<IConnectionMetricsTagsFeature>() is { } metricsTags) 215var hasTls = _context.ConnectionFeatures.Get<ITlsConnectionFeature>() != null; 216var applicationProtocol = _context.ConnectionFeatures.Get<ITlsApplicationProtocolFeature>()?.ApplicationProtocol
Internal\Infrastructure\TransportConnectionManager.cs (1)
82connection.TransportConnection.Features.Get<IConnectionMetricsContextFeature>()?.MetricsContext,
Internal\TlsConnectionFeature.cs (1)
108_context.Features.Get<IConnectionLifetimeNotificationFeature>()?.RequestClose();
Middleware\HttpConnectionMiddleware.cs (2)
30var memoryPoolFeature = connectionContext.Features.Get<IMemoryPoolFeature>(); 31var protocols = connectionContext.Features.Get<HttpProtocolsFeature>()?.HttpProtocols ?? _endpointDefaultProtocols;
Middleware\HttpMultiplexedConnectionMiddleware.cs (2)
30var memoryPoolFeature = connectionContext.Features.Get<IMemoryPoolFeature>(); 47if (connectionContext.Features.Get<IConnectionMetricsTagsFeature>() is { } metricsTags)
Middleware\HttpsConnectionMiddleware.cs (3)
136if (context.Features.Get<ITlsConnectionFeature>() != null) 144context.Features.Get<IMemoryPoolFeature>()?.MemoryPool ?? MemoryPool<byte>.Shared); 157var metricsTagsFeature = context.Features.Get<IConnectionMetricsTagsFeature>();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (32)
Http1\Http1ConnectionTests.cs (4)
160Assert.Equal("http", ((IFeatureCollection)_http1Connection).Get<IHttpRequestFeature>().Scheme); 187var feature = ((IFeatureCollection)_http1Connection).Get<IHttpRequestIdentifierFeature>(); 332((IFeatureCollection)_http1Connection).Get<IHttpMinRequestBodyDataRateFeature>().MinDataRate = minDataRate; 341((IFeatureCollection)_http1Connection).Get<IHttpMinResponseDataRateFeature>().MinDataRate = minDataRate;
Http1\Http1HttpProtocolFeatureCollectionTests.cs (13)
164Assert.NotNull(_collection.Get<IHttpMinResponseDataRateFeature>()); 182Assert.Same(_collection.Get<IHttpRequestFeature>(), _collection[typeof(IHttpRequestFeature)]); 183Assert.Same(_collection.Get<IHttpRequestBodyDetectionFeature>(), _collection[typeof(IHttpRequestBodyDetectionFeature)]); 184Assert.Same(_collection.Get<IHttpResponseFeature>(), _collection[typeof(IHttpResponseFeature)]); 185Assert.Same(_collection.Get<IHttpResponseBodyFeature>(), _collection[typeof(IHttpResponseBodyFeature)]); 186Assert.Same(_collection.Get<IRequestBodyPipeFeature>(), _collection[typeof(IRequestBodyPipeFeature)]); 187Assert.Same(_collection.Get<IHttpRequestIdentifierFeature>(), _collection[typeof(IHttpRequestIdentifierFeature)]); 188Assert.Same(_collection.Get<IHttpRequestLifetimeFeature>(), _collection[typeof(IHttpRequestLifetimeFeature)]); 189Assert.Same(_collection.Get<IHttpConnectionFeature>(), _collection[typeof(IHttpConnectionFeature)]); 190Assert.Same(_collection.Get<IHttpMaxRequestBodySizeFeature>(), _collection[typeof(IHttpMaxRequestBodySizeFeature)]); 191Assert.Same(_collection.Get<IHttpMinRequestBodyDataRateFeature>(), _collection[typeof(IHttpMinRequestBodyDataRateFeature)]); 192Assert.Same(_collection.Get<IHttpMinResponseDataRateFeature>(), _collection[typeof(IHttpMinResponseDataRateFeature)]); 193Assert.Same(_collection.Get<IHttpBodyControlFeature>(), _collection[typeof(IHttpBodyControlFeature)]);
Http2\Http2HttpProtocolFeatureCollectionTests.cs (3)
35Assert.Null(_http2Collection.Get<IHttpMinResponseDataRateFeature>()); 41var upgradeFeature = _http2Collection.Get<IHttpUpgradeFeature>(); 50var minRateFeature = _http2Collection.Get<IHttpMinRequestBodyDataRateFeature>();
Http3\Http3HttpProtocolFeatureCollectionTests.cs (3)
35Assert.Null(_http3Collection.Get<IHttpMinResponseDataRateFeature>()); 41var upgradeFeature = _http3Collection.Get<IHttpUpgradeFeature>(); 50var minRateFeature = _http3Collection.Get<IHttpMinRequestBodyDataRateFeature>();
KestrelServerTests.cs (7)
53server.Features.Get<IServerAddressesFeature>().Addresses.Add("http:/asdf"); 69server.Features.Get<IServerAddressesFeature>().Addresses.Add("https://127.0.0.1:0"); 85server.Features.Get<IServerAddressesFeature>().Addresses.Add("https://127.0.0.1:0"); 97server.Features.Get<IServerAddressesFeature>().Addresses.Add("http://127.0.0.1:0"); 111server.Features.Get<IServerAddressesFeature>().Addresses.Add("https://127.0.0.1:0"); 124server.Features.Get<IServerAddressesFeature>().Addresses.Add("http://127.0.0.1:0/base"); 149server.Features.Get<IServerAddressesFeature>().Addresses.Add(ignoredAddress);
SniOptionsSelectorTests.cs (2)
603var httpProtocolsFeature = mockConnectionContext.Features.Get<HttpProtocolsFeature>(); 666var httpProtocolsFeature = mockConnectionContext.Features.Get<HttpProtocolsFeature>();
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (30)
HttpProtocolFeatureCollection.cs (29)
28return _collection.Get<IHttpRequestFeature>(); 35return _collection.Get<IHttpResponseFeature>(); 42return _collection.Get<IHttpResponseBodyFeature>(); 49return _collection.Get<IRouteValuesFeature>(); 56return _collection.Get<IEndpointFeature>(); 63return _collection.Get<IServiceProvidersFeature>(); 70return _collection.Get<IItemsFeature>(); 77return _collection.Get<IQueryFeature>(); 84return _collection.Get<IRequestBodyPipeFeature>(); 91return _collection.Get<IFormFeature>(); 98return _collection.Get<IHttpAuthenticationFeature>(); 105return _collection.Get<IHttpRequestIdentifierFeature>(); 112return _collection.Get<IHttpConnectionFeature>(); 119return _collection.Get<ISessionFeature>(); 126return _collection.Get<IResponseCookiesFeature>(); 133return _collection.Get<IHttpRequestTrailersFeature>(); 140return _collection.Get<IHttpResponseTrailersFeature>(); 147return _collection.Get<ITlsConnectionFeature>(); 154return _collection.Get<IHttpUpgradeFeature>(); 161return _collection.Get<IHttpWebSocketFeature>(); 168return _collection.Get<IHttp2StreamIdFeature>(); 175return _collection.Get<IHttpRequestLifetimeFeature>(); 182return _collection.Get<IHttpMaxRequestBodySizeFeature>(); 189return _collection.Get<IHttpMinRequestBodyDataRateFeature>(); 196return _collection.Get<IHttpMinResponseDataRateFeature>(); 203return _collection.Get<IHttpBodyControlFeature>(); 210return _collection.Get<IHttpRequestBodyDetectionFeature>(); 217return _collection.Get<IHttpResetFeature>(); 224return _collection.Get<IHttpNotFoundFeature>();
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
320feature = MultiplexedConnectionFeatures.Get<TFeature>();
Microsoft.AspNetCore.Server.Kestrel.Tests (2)
HttpsConfigurationTests.cs (2)
42Assert.Single(host.ServerFeatures.Get<IServerAddressesFeature>().Addresses, address); 71Assert.Equal(new[] { httpAddress, httpsAddress }, host.ServerFeatures.Get<IServerAddressesFeature>().Addresses);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
320feature = MultiplexedConnectionFeatures.Get<TFeature>();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (4)
Internal\QuicConnectionContext.cs (2)
214var streamDirectionFeature = features?.Get<IStreamDirectionFeature>(); 254var heartbeatFeature = Features.Get<IConnectionHeartbeatFeature>();
QuicTransportFactory.cs (1)
42var tlsConnectionOptions = features?.Get<TlsConnectionCallbackOptions>();
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
320feature = MultiplexedConnectionFeatures.Get<TFeature>();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (2)
QuicConnectionListenerTests.cs (1)
141var tlsFeature = features.Get<ITlsConnectionFeature>();
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (1)
30return host.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>().Addresses
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
320feature = MultiplexedConnectionFeatures.Get<TFeature>();
Microsoft.AspNetCore.Session.Tests (2)
SessionTests.cs (2)
523Assert.Null(httpContext.Features.Get<ISessionFeature>()); 574Assert.Null(httpContext.Features.Get<ISessionFeature>());
Microsoft.AspNetCore.SignalR (2)
GetHttpContextExtensions.cs (2)
22return connection.Features.Get<IHttpContextFeature>()?.HttpContext; 33return connection.Features.Get<IHttpContextFeature>()?.HttpContext;
Microsoft.AspNetCore.SignalR.Client.Core (6)
HubConnection.cs (6)
493var statefulReconnectFeature = connection.Features.Get<IStatefulReconnectFeature>(); 538if (!(connection.Features.Get<IConnectionInherentKeepAliveFeature>()?.HasInherentKeepAlive ?? false)) 615if (connectionState.Connection.Features.Get<IStatefulReconnectFeature>() is IStatefulReconnectFeature feature) 1339if (connectionState.Connection.Features.Get<IStatefulReconnectFeature>() is IStatefulReconnectFeature feature) 2156_hasInherentKeepAlive = connection.Features.Get<IConnectionInherentKeepAliveFeature>()?.HasInherentKeepAlive ?? false; 2159if (Connection.Features.Get<IStatefulReconnectFeature>() is IStatefulReconnectFeature feature)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
Hubs.cs (2)
83var feature = Context.Features.Get<IHttpConnectionFeature>(); 98return Context.Features.Get<IHttpTransportFeature>().TransportType.ToString();
Microsoft.AspNetCore.SignalR.Client.Tests (1)
HttpConnectionTests.Transport.cs (1)
97var feature = connection.Features.Get<IConnectionInherentKeepAliveFeature>();
Microsoft.AspNetCore.SignalR.Core (8)
HubConnectionContext.cs (8)
84if (connectionContext.Features.Get<IConnectionLifetimeNotificationFeature>() is IConnectionLifetimeNotificationFeature lifetimeNotification) 139_user = Features.Get<IConnectionUserFeature>()?.User ?? new ClaimsPrincipal(); 463if (_useStatefulReconnect && _connectionContext.Features.Get<IStatefulReconnectFeature>() is IStatefulReconnectFeature feature) 563var transferFormatFeature = Features.Get<ITransferFormatFeature>(); 581if (Features.Get<IConnectionInherentKeepAliveFeature>()?.HasInherentKeepAlive != true) 584Features.Get<IConnectionHeartbeatFeature>()?.OnHeartbeat(state => ((HubConnectionContext)state).KeepAliveTick(), this); 588if (_connectionContext.Features.Get<IStatefulReconnectFeature>() is IStatefulReconnectFeature feature) 701Features.Get<IConnectionHeartbeatFeature>()?.OnHeartbeat(state => ((HubConnectionContext)state).CheckClientTimeout(), this);
Microsoft.AspNetCore.SignalR.Tests (2)
HttpHeaderConnectionHandler.cs (1)
23var headers = connection.Features.Get<IHttpContextFeature>().HttpContext.Request.Headers;
HubConnectionHandlerTests.cs (1)
2290client.Connection.Features.Get<IConnectionLifetimeNotificationFeature>().RequestClose();
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
src\Shared\SignalR\InProcessTestServer.cs (1)
129_url = _host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.Single();
Microsoft.AspNetCore.StaticFiles (1)
StaticFileContext.cs (1)
410var responseCompressionFeature = _context.Features.Get<IHttpsCompressionFeature>();
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
Helpers.cs (1)
15return server.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.First();
Microsoft.AspNetCore.TestHost (1)
ClientHandler.cs (1)
197var responseTrailersFeature = context.Features.Get<IHttpResponseTrailersFeature>();
Microsoft.AspNetCore.TestHost.Tests (47)
ClientHandlerTests.cs (31)
26Assert.True(features.Get<IHttpRequestLifetimeFeature>().RequestAborted.CanBeCanceled); 27Assert.Equal(HttpProtocol.Http11, features.Get<IHttpRequestFeature>().Protocol); 28Assert.Equal("GET", features.Get<IHttpRequestFeature>().Method); 29Assert.Equal("https", features.Get<IHttpRequestFeature>().Scheme); 30Assert.Equal("/api/a%2Fb c", features.Get<IHttpRequestFeature>().Path); 31Assert.NotNull(features.Get<IHttpRequestFeature>().Body); 32Assert.NotNull(features.Get<IHttpRequestFeature>().Headers); 33Assert.NotNull(features.Get<IHttpResponseFeature>().Headers); 34Assert.NotNull(features.Get<IHttpResponseBodyFeature>().Stream); 35Assert.Equal(200, features.Get<IHttpResponseFeature>().StatusCode); 36Assert.Null(features.Get<IHttpResponseFeature>().ReasonPhrase); 37Assert.Equal("example.com", features.Get<IHttpRequestFeature>().Headers["host"]); 38Assert.NotNull(features.Get<IHttpRequestLifetimeFeature>()); 61Assert.Null(context.Features.Get<IHttpResponseFeature>().ReasonPhrase); 75Assert.True(features.Get<IHttpRequestLifetimeFeature>().RequestAborted.CanBeCanceled); 76Assert.Equal(HttpProtocol.Http11, features.Get<IHttpRequestFeature>().Protocol); 77Assert.Equal("GET", features.Get<IHttpRequestFeature>().Method); 78Assert.Equal("https", features.Get<IHttpRequestFeature>().Scheme); 79Assert.Equal("/A/Path", features.Get<IHttpRequestFeature>().PathBase); 80Assert.Equal("/and/file.txt", features.Get<IHttpRequestFeature>().Path); 81Assert.Equal("?and=query", features.Get<IHttpRequestFeature>().QueryString); 82Assert.NotNull(features.Get<IHttpRequestFeature>().Body); 83Assert.NotNull(features.Get<IHttpRequestFeature>().Headers); 84Assert.NotNull(features.Get<IHttpResponseFeature>().Headers); 85Assert.NotNull(features.Get<IHttpResponseBodyFeature>().Stream); 86Assert.Equal(200, features.Get<IHttpResponseFeature>().StatusCode); 87Assert.Null(features.Get<IHttpResponseFeature>().ReasonPhrase); 88Assert.Equal("example.com", features.Get<IHttpRequestFeature>().Headers["host"]); 89Assert.NotNull(features.Get<IHttpRequestLifetimeFeature>()); 267Assert.Equal(IPAddress.Parse("1.1.1.1"), features.Get<IHttpConnectionFeature>().RemoteIpAddress); 282Assert.Equal("?and=something", features.Get<IHttpRequestFeature>().QueryString);
HttpContextBuilderTests.cs (2)
44Assert.Null(context.Features.Get<IHttpResponseFeature>().ReasonPhrase); 127c.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true;
ResponseResetTests.cs (7)
23var feature = httpContext.Features.Get<IHttpResetFeature>(); 39var feature = httpContext.Features.Get<IHttpResetFeature>(); 55var feature = httpContext.Features.Get<IHttpResetFeature>(); 74var feature = httpContext.Features.Get<IHttpResetFeature>(); 93var feature = httpContext.Features.Get<IHttpResetFeature>(); 115var feature = httpContext.Features.Get<IHttpResetFeature>(); 141var feature = httpContext.Features.Get<IHttpResetFeature>();
TestClientTests.cs (2)
1027var upgradeFeature = c.Features.Get<IHttpUpgradeFeature>(); 1033var webSocketFeature = c.Features.Get<IHttpWebSocketFeature>();
TestServerTests.cs (2)
268var serverAddressesFeature = applicationBuilder.ServerFeatures.Get<IServerAddressesFeature>(); 289var serverAddressesFeature = applicationBuilder.ServerFeatures.Get<IServerAddressesFeature>();
Utilities.cs (1)
15return request.HttpContext.Features.Get<IHttpRequestBodyDetectionFeature>()?.CanHaveBody;
WebSocketClientTests.cs (2)
102var upgradeFeature = c.Features.Get<IHttpUpgradeFeature>(); 107var webSocketFeature = c.Features.Get<IHttpWebSocketFeature>();
Microsoft.AspNetCore.Testing (1)
ServiceFakesHostExtensions.cs (1)
70var feature = server.Features.Get<IServerAddressesFeature>();
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (2)
2452var authFeature = context.Features.Get<IAuthenticationFeature>(); 2492var authFeature = context.Features.Get<IAuthenticationFeature>();
Microsoft.AspNetCore.WebSockets (4)
WebSocketMiddleware.cs (4)
59var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 60var connectFeature = context.Features.Get<IHttpExtendedConnectFeature>(); 61if ((upgradeFeature != null || connectFeature != null) && context.Features.Get<IHttpWebSocketFeature>() == null) 211_context.Features.Get<IHttpRequestTimeoutFeature>()?.DisableTimeout();
Microsoft.AspNetCore.WebSockets.Tests (2)
IHostPortExtensions.cs (1)
26return host.Services.GetService<IServer>().Features.Get<IServerAddressesFeature>().Addresses
WebSocketMiddlewareTests.cs (1)
783var feature = Assert.IsType<HttpRequestTimeoutFeature>(context.Features.Get<IHttpRequestTimeoutFeature>());
Microsoft.Extensions.Features (2)
FeatureCollectionExtensions.cs (1)
26return featureCollection.Get<TFeature>() ?? throw new InvalidOperationException($"Feature '{typeof(TFeature)}' is not present.");
FeatureReferences.cs (1)
120cached = Collection.Get<TFeature>();
Microsoft.Extensions.ServiceDiscovery (1)
ServiceEndpointWatcher.Log.cs (1)
30if (ep.Features.Get<IServiceEndpointProvider>() is { } provider)
Mvc.RoutingWebSite (1)
Controllers\RoutingController.cs (1)
13var endpointFeature = HttpContext.Features.Get<IEndpointFeature>();
NativeIISSample (3)
Startup.cs (3)
89if (context.Features.Get<IHttpUpgradeFeature>() != null) 101var addresses = server.Features.Get<IServerAddressesFeature>(); 107if (server.Features.Get<IIISEnvironmentFeature>() is { } envFeature)
OutputCachingSample (1)
Startup.cs (1)
68var cacheContext = context.Features.Get<IOutputCacheFeature>()?.Context;
ResponseCompressionSample (1)
Startup.cs (1)
48context.Features.Get<IHttpResponseBodyFeature>().DisableBuffering();
SignalR.Client.FunctionalTestApp (2)
Startup.cs (1)
73var endpoint = context.HttpContext.Features.Get<IEndpointFeature>()?.Endpoint;
TestHub.cs (1)
112return Context.Features.Get<IHttpTransportFeature>().TransportType.ToString();
SignalRSamples (1)
ConnectionHandlers\MessagesConnectionHandler.cs (1)
19var transportType = connection.Features.Get<IHttpTransportFeature>()?.TransportType;
SocialWeather (1)
PersistentConnectionLifeTimeManager.cs (1)
27var transferFormatFeature = connection.Features.Get<ITransferFormatFeature>();
Sockets.BindTests (6)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (1)
30return host.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>().Addresses
src\Servers\Kestrel\shared\test\TransportTestHelpers\IWebHostPortExtensions.cs (1)
26return host.ServerFeatures.Get<IServerAddressesFeature>().Addresses
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (4)
247var serverAddresses = app.ServerFeatures.Get<IServerAddressesFeature>(); 632var serverAddresses = host.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>().Addresses; 677var serverAddresses = host.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>().Addresses; 717var serverAddresses = host.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>().Addresses;
Sockets.FunctionalTests (11)
SocketTransportTests.cs (1)
37var socket = context.Features.Get<IConnectionSocketFeature>().Socket;
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (1)
30return host.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>().Addresses
src\Servers\Kestrel\shared\test\TransportTestHelpers\IWebHostPortExtensions.cs (1)
26return host.ServerFeatures.Get<IServerAddressesFeature>().Addresses
src\Servers\Kestrel\test\FunctionalTests\Http2\HandshakeTests.cs (2)
71var tlsFeature = context.Features.Get<ITlsApplicationProtocolFeature>(); 99var tlsFeature = context.Features.Get<ITlsApplicationProtocolFeature>();
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (4)
742var connectionLifetimeFeature = context.Features.Get<IConnectionLifetimeFeature>(); 774var connectionLifetimeFeature = context.Features.Get<IConnectionLifetimeFeature>(); 810var connectionLifetimeFeature = context.Features.Get<IConnectionLifetimeFeature>(); 861var lifetime = httpContext.Features.Get<IHttpRequestLifetimeFeature>();
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (1)
214var lifetime = httpContext.Features.Get<IHttpRequestLifetimeFeature>();
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (1)
49var notificationFeature = connection.Features.Get<IConnectionLifetimeNotificationFeature>();
StartRequestDelegateUrlApp (1)
Program.cs (1)
30var addresses = host.ServerFeatures.Get<IServerAddressesFeature>().Addresses;
StartRouteBuilderUrlApp (1)
Program.cs (1)
31var addresses = host.ServerFeatures.Get<IServerAddressesFeature>().Addresses;
StartWithIApplicationBuilderUrlApp (1)
Program.cs (1)
34var addresses = host.ServerFeatures.Get<IServerAddressesFeature>().Addresses;
StatusCodePagesSample (1)
Startup.cs (1)
45var statusCodePagesFeature = context.Features.Get<IStatusCodePagesFeature>();
TestProject.ServiceA (1)
Program.cs (1)
13app.MapGet("/urls", (IServiceProvider sp) => sp.GetService<IServer>()?.Features?.Get<IServerAddressesFeature>()?.Addresses);
VersioningWebSite (1)
Controllers\RoutingController.cs (1)
13var endpointFeature = HttpContext.Features.Get<IEndpointFeature>();
Wasm.Performance.Driver (1)
Program.cs (1)
330.Get<IServerAddressesFeature>()