13 implementations of
InMemory.FunctionalTests (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
126object? IFeatureCollection.this[Type key]
Microsoft.AspNetCore.Hosting.Tests (2)
HostingApplicationTests.cs (1)
214public object this[Type key] { get => Features[key]; set => Features[key] = value; }
WebHostTests.cs (1)
1306public object this[Type key]
Microsoft.AspNetCore.Owin (1)
OwinFeatureCollection.cs (1)
337public object this[Type key]
Microsoft.AspNetCore.Server.HttpSys (1)
StandardFeatureCollection.cs (1)
70public object? this[Type key]
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpContext.FeatureCollection.cs (1)
310object? IFeatureCollection.this[Type key]
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\HttpProtocol.Generated.cs (1)
187object? IFeatureCollection.this[Type key]
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
126object? IFeatureCollection.this[Type key]
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
126object? IFeatureCollection.this[Type key]
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
126object? IFeatureCollection.this[Type key]
src\Servers\Kestrel\shared\TransportMultiplexedConnection.Generated.cs (1)
113object? IFeatureCollection.this[Type key]
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
src\Servers\Kestrel\shared\TransportConnection.Generated.cs (1)
126object? IFeatureCollection.this[Type key]
Microsoft.Extensions.Features (1)
FeatureCollection.cs (1)
64public object? this[Type key]
27 writes to
Microsoft.AspNetCore.AsyncState (1)
AsyncContextHttpContext.cs (1)
44httpContext.Features[typeof(TypeWrapper<T>)] = value;
Microsoft.AspNetCore.Hosting.Tests (1)
HostingApplicationTests.cs (1)
214public object this[Type key] { get => Features[key]; set => Features[key] = value; }
Microsoft.AspNetCore.Owin (1)
OwinEnvironment.cs (1)
416context.Features[FeatureInterface] = feature;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (22)
Http1\Http1HttpProtocolFeatureCollectionTests.cs (22)
104_collection[typeof(IHttpRequestFeature)] = CreateHttp1Connection(); 105_collection[typeof(IHttpRequestBodyDetectionFeature)] = CreateHttp1Connection(); 106_collection[typeof(IHttpResponseFeature)] = CreateHttp1Connection(); 107_collection[typeof(IHttpResponseBodyFeature)] = CreateHttp1Connection(); 108_collection[typeof(IRequestBodyPipeFeature)] = CreateHttp1Connection(); 109_collection[typeof(IHttpRequestIdentifierFeature)] = CreateHttp1Connection(); 110_collection[typeof(IHttpRequestLifetimeFeature)] = CreateHttp1Connection(); 111_collection[typeof(IHttpRequestTrailersFeature)] = CreateHttp1Connection(); 112_collection[typeof(IHttpConnectionFeature)] = CreateHttp1Connection(); 113_collection[typeof(IHttpMaxRequestBodySizeFeature)] = CreateHttp1Connection(); 114_collection[typeof(IHttpMinRequestBodyDataRateFeature)] = CreateHttp1Connection(); 115_collection[typeof(IHttpMinResponseDataRateFeature)] = CreateHttp1Connection(); 116_collection[typeof(IHttpBodyControlFeature)] = CreateHttp1Connection(); 117_collection[typeof(IRouteValuesFeature)] = CreateHttp1Connection(); 118_collection[typeof(IEndpointFeature)] = CreateHttp1Connection(); 119_collection[typeof(IHttpExtendedConnectFeature)] = CreateHttp1Connection(); 120_collection[typeof(IHttpUpgradeFeature)] = CreateHttp1Connection(); 121_collection[typeof(IPersistentStateFeature)] = CreateHttp1Connection(); 170_collection[typeof(string)] = null; 173_collection[typeof(string)] = "A string"; 176_collection[typeof(string)] = null; 248_collection[type] = CreateHttp1Connection();
Microsoft.AspNetCore.Testing.Tests (1)
FakesExtensionsTests.cs (1)
197hostMock.Object.Services.GetRequiredService<IServer>().Features[typeof(IServerAddressesFeature)] = null;
Microsoft.Extensions.Features (1)
FeatureReference.cs (1)
50features[typeof(T)] = feature;
25 references to
Microsoft.AspNetCore.AsyncState (1)
AsyncContextHttpContext.cs (1)
56value = (T?)httpContext.Features[typeof(TypeWrapper<T>)];
Microsoft.AspNetCore.Hosting.Tests (1)
HostingApplicationTests.cs (1)
214public object this[Type key] { get => Features[key]; set => Features[key] = value; }
Microsoft.AspNetCore.Http.Tests (2)
DefaultHttpContextTests.cs (2)
384Assert.Same(features[field.FieldType], v); 404Assert.Same(features[property.PropertyType], v);
Microsoft.AspNetCore.Mvc.Core.Test (1)
Routing\MvcRouteHandlerTests.cs (1)
112.Setup(h => h.Features[typeof(IRoutingFeature)])
Microsoft.AspNetCore.Owin (2)
OwinEnvironment.cs (2)
390object featureInstance = context.Features[FeatureInterface]; 406var feature = context.Features[FeatureInterface];
Microsoft.AspNetCore.Owin.Tests (1)
OwinFeatureCollectionTests.cs (1)
13return (T)features[typeof(T)];
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (15)
Http1\Http1HttpProtocolFeatureCollectionTests.cs (15)
69Assert.Same(_collection[type], feature.Value); 70Assert.NotSame(_collection[type], _collection); 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)]); 231var featureLookup = _collection[type];
Microsoft.Extensions.Features (2)
FeatureCollectionExtensions.cs (1)
41return featureCollection[key] ?? throw new InvalidOperationException($"Feature '{key}' is not present.");
FeatureReference.cs (1)
37_feature = (T?)features[typeof(T)];