26 overrides of Features
ClientSample (1)
Tcp\TcpConnection.cs (1)
42public override IFeatureCollection Features { get; } = new FeatureCollection();
InMemory.FunctionalTests (4)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
1022public override IFeatureCollection Features { get; } 1188public override IFeatureCollection Features { get; }
src\Servers\Kestrel\shared\test\TestContextFactory.cs (1)
242public override IFeatureCollection Features { get; }
src\Servers\Kestrel\shared\TransportConnection.cs (1)
36public override IFeatureCollection Features => this;
Microsoft.AspNetCore.Connections.Abstractions (1)
DefaultConnectionContext.cs (1)
75public override IFeatureCollection Features { get; }
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionContext.cs (1)
164public override IFeatureCollection Features { get; }
Microsoft.AspNetCore.Http.Connections.Client (1)
HttpConnection.cs (1)
71public override IFeatureCollection Features { get; } = new FeatureCollection();
Microsoft.AspNetCore.Server.Kestrel.Core (4)
HttpsConfigurationService.cs (1)
205public override IFeatureCollection Features => _inner.Features;
Internal\WebTransport\WebTransportStream.cs (1)
32public override IFeatureCollection Features => _features;
Middleware\LoggingMultiplexedConnectionMiddleware.cs (2)
44public override IFeatureCollection Features => _inner.Features; 121public override IFeatureCollection Features => _inner.Features;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
SniOptionsSelectorTests.cs (1)
941public override IFeatureCollection Features { get; } = new FeatureCollection();
src\Servers\Kestrel\shared\test\TestContextFactory.cs (1)
242public override IFeatureCollection Features { get; }
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (4)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (2)
1022public override IFeatureCollection Features { get; } 1188public override IFeatureCollection Features { get; }
src\Servers\Kestrel\shared\test\TestContextFactory.cs (1)
242public override IFeatureCollection Features { get; }
src\Servers\Kestrel\shared\TransportConnection.cs (1)
36public override IFeatureCollection Features => this;
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Servers\Kestrel\shared\TransportConnection.cs (1)
36public override IFeatureCollection Features => this;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
src\Servers\Kestrel\shared\TransportConnection.cs (1)
36public override IFeatureCollection Features => this;
src\Servers\Kestrel\shared\TransportMultiplexedConnection.cs (1)
30public override IFeatureCollection Features => this;
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
src\Servers\Kestrel\shared\TransportConnection.cs (1)
36public override IFeatureCollection Features => this;
Microsoft.AspNetCore.SignalR.Client.Tests (2)
HubConnectionTests.Reconnect.cs (1)
1177public override IFeatureCollection Features => _inner.Features;
TestConnection.cs (1)
41public override IFeatureCollection Features { get; } = new FeatureCollection();
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
Shared\TestConnectionContext.cs (1)
13public override IFeatureCollection Features { get; } = new FeatureCollection();
Microsoft.AspNetCore.SignalR.Tests (1)
Internal\MessageBufferTests.cs (1)
501public override IFeatureCollection Features { get; } = new FeatureCollection();
90 references to Features
Aspire.Dashboard (1)
Authentication\Connection\ConnectionTypeMiddleware.cs (1)
26context.Features.Set<IConnectionTypeFeature>(new ConnectionTypeFeature { ConnectionTypes = _connectionTypes });
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>();
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;
IISExpress.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
86var memoryPool = context.Features.Get<IMemoryPoolFeature>()?.MemoryPool;
InMemory.FunctionalTests (11)
Http2\Http2TestBase.cs (1)
484_mockConnectionContext.Setup(x => x.Features).Returns(features);
Http3\Http3ConnectionTests.cs (2)
472var http3Stream1 = (Http3Stream)streamContext1.Features.Get<IPersistentStateFeature>().State[Http3Connection.StreamPersistentStateKey]; 479var http3Stream2 = (Http3Stream)streamContext2.Features.Get<IPersistentStateFeature>().State[Http3Connection.StreamPersistentStateKey];
Http3\WebTransport\WebTransportStreamTests.cs (1)
23var streamDirectionFeature = stream.Features.GetRequiredFeature<IStreamDirectionFeature>();
HttpsConnectionMiddlewareTests.cs (3)
311Assert.NotNull(connection.Features.Get<SslStream>()); 375Assert.NotNull(connection.Features.Get<SslStream>()); 448Assert.NotNull(connection.Features.Get<SslStream>());
KestrelMetricsTests.cs (4)
51connectionContext.Features.Get<IConnectionMetricsTagsFeature>().Tags.Add(new KeyValuePair<string, object>("custom", "value!")); 114hasConnectionMetricsTagsFeature = connectionContext.Features.Get<IConnectionMetricsTagsFeature>() != null; 330connectionContext.Features.Get<IConnectionMetricsTagsFeature>().Tags.Add(new KeyValuePair<string, object>("custom", "value!")); 364Assert.NotEqual(overridenFeature, currentConnectionContext.Features.Get<IConnectionMetricsTagsFeature>());
Interop.FunctionalTests (2)
Http3\Http3RequestTests.cs (2)
1228context.Features.Set<IMemoryPoolFeature>(new MemoryPoolFeature() { MemoryPool = memoryPool }); 1240context.Features.Set<IMemoryPoolFeature>(new MemoryPoolFeature() { MemoryPool = memoryPool });
Microsoft.AspNetCore.Connections.Abstractions (1)
ConnectionContext.cs (1)
29Features.Get<IConnectionLifetimeFeature>()?.Abort();
Microsoft.AspNetCore.Http.Connections (1)
HttpConnectionContextExtensions.cs (1)
25return connection.Features.Get<IHttpContextFeature>()?.HttpContext;
Microsoft.AspNetCore.Http.Connections.Common (1)
NegotiationResponse.cs (1)
52/// It should also set <see cref="IStatefulReconnectFeature"/> on the <see cref="BaseConnectionContext.Features"/> collection so other layers of the
Microsoft.AspNetCore.Http.Connections.Tests (9)
HttpConnectionDispatcherTests.cs (9)
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>(); 2469var reconnectFeature = connection.Features.Get<IStatefulReconnectFeature>(); 3556var feature = Assert.IsType<HttpRequestTimeoutFeature>(context.Features.Get<IHttpContextFeature>()?.HttpContext.Features.Get<IHttpRequestTimeoutFeature>()); 4000var reconnectFeature = connection.Features.Get<IStatefulReconnectFeature>();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
86var memoryPool = context.Features.Get<IMemoryPoolFeature>()?.MemoryPool;
Microsoft.AspNetCore.Server.Kestrel.Core (39)
HttpsConfigurationService.cs (1)
205public override IFeatureCollection Features => _inner.Features;
Internal\Http3\Http3Connection.cs (5)
381var streamDirectionFeature = streamContext.Features.Get<IStreamDirectionFeature>(); 382var streamIdFeature = streamContext.Features.Get<IStreamIdFeature>(); 588streamContext.Features.GetRequiredFeature<IProtocolErrorCodeFeature>().Error = (long)Http3ErrorCode.RequestRejected; 598var persistentStateFeature = streamContext.Features.Get<IPersistentStateFeature>(); 667streamContext.Features,
Internal\Http3\Http3ControlStream.cs (1)
391_context.ConnectionContext.Features.Get<IConnectionLifetimeNotificationFeature>()?.RequestClose();
Internal\HttpConnection.cs (1)
138if (_context.ConnectionContext.Features.Get<IConnectionMetricsTagsFeature>() is { } metricsTags)
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\Infrastructure\TransportConnectionManager.cs (1)
82connection.TransportConnection.Features.Get<IConnectionMetricsContextFeature>()?.MetricsContext,
Internal\SniOptionsSelector.cs (1)
148connection.Features.Set(new HttpProtocolsFeature(sniOptions.HttpProtocols));
Internal\TlsConnectionFeature.cs (1)
115_context.Features.Get<IConnectionLifetimeNotificationFeature>()?.RequestClose();
Middleware\ConnectionLimitMiddleware.cs (2)
38_metrics.ConnectionRejected(connection.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext); 47connection.Features.Set<IDecrementConcurrentConnectionCountFeature>(releasor);
Middleware\HttpConnectionMiddleware.cs (4)
30var memoryPoolFeature = connectionContext.Features.Get<IMemoryPoolFeature>(); 31var protocols = connectionContext.Features.Get<HttpProtocolsFeature>()?.HttpProtocols ?? _endpointDefaultProtocols; 32var metricContext = connectionContext.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext; 42connectionContext.Features,
Middleware\HttpMultiplexedConnectionMiddleware.cs (4)
30var memoryPoolFeature = connectionContext.Features.Get<IMemoryPoolFeature>(); 33var metricContext = connectionContext.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext; 41connectionContext.Features, 47if (connectionContext.Features.Get<IConnectionMetricsTagsFeature>() is { } metricsTags)
Middleware\HttpsConnectionMiddleware.cs (11)
136if (context.Features.Get<ITlsConnectionFeature>() != null) 144context.Features.Get<IMemoryPoolFeature>()?.MemoryPool ?? MemoryPool<byte>.Shared); 151context.Features.Set<ITlsConnectionFeature>(feature); 152context.Features.Set<ITlsHandshakeFeature>(feature); 153context.Features.Set<ITlsApplicationProtocolFeature>(feature); 154context.Features.Set<ISslStreamFeature>(feature); 155context.Features.Set<SslStream>(sslStream); // Anti-pattern, but retain for back compat 157var metricsTagsFeature = context.Features.Get<IConnectionMetricsTagsFeature>(); 158var metricsContext = context.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext; 352_metrics.TlsHandshakeStart(context.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext); 444context.Features.Set(sslStream);
Middleware\LoggingMultiplexedConnectionMiddleware.cs (2)
44public override IFeatureCollection Features => _inner.Features; 121public override IFeatureCollection Features => _inner.Features;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
QuicTestHelpers.cs (1)
103connection?.Features.Set<IConnectionHeartbeatFeature>(new TestConnectionHeartbeatFeature());
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.Tests (1)
HubConnectionTests.Reconnect.cs (1)
1177public override IFeatureCollection Features => _inner.Features;
Microsoft.AspNetCore.SignalR.Core (4)
HubConnectionContext.cs (4)
84if (connectionContext.Features.Get<IConnectionLifetimeNotificationFeature>() is IConnectionLifetimeNotificationFeature lifetimeNotification) 148public virtual IFeatureCollection Features => _connectionContext.Features; 463if (_useStatefulReconnect && _connectionContext.Features.Get<IStatefulReconnectFeature>() is IStatefulReconnectFeature feature) 588if (_connectionContext.Features.Get<IStatefulReconnectFeature>() is IStatefulReconnectFeature feature)
Microsoft.AspNetCore.SignalR.Tests (1)
HttpHeaderConnectionHandler.cs (1)
23var headers = connection.Features.Get<IHttpContextFeature>().HttpContext.Request.Headers;
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.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (1)
49var notificationFeature = connection.Features.Get<IConnectionLifetimeNotificationFeature>();
WebTransportInteractiveSampleApp (1)
Program.cs (1)
77direction = stream.Features.GetRequiredFeature<IStreamDirectionFeature>();