43 references to GetRequiredFeature
InMemory.FunctionalTests (4)
Http3\WebTransport\WebTransportHandshakeTests.cs (1)
31var webTransportFeature = context.Features.GetRequiredFeature<IHttpWebTransportFeature>();
Http3\WebTransport\WebTransportStreamTests.cs (1)
23var streamDirectionFeature = stream.Features.GetRequiredFeature<IStreamDirectionFeature>();
Http3\WebTransport\WebTransportTestUtilities.cs (1)
31var webTransportFeature = context.Features.GetRequiredFeature<IHttpWebTransportFeature>();
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
233var metricsContext = MultiplexedConnectionContext.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext;
Microsoft.AspNetCore (1)
WebApplication.cs (1)
69public ICollection<string> Urls => ServerFeatures.GetRequiredFeature<IServerAddressesFeature>().Addresses;
Microsoft.AspNetCore.Components.Endpoints (1)
RazorComponentEndpointInvoker.cs (1)
126var bufferingFeature = context.Features.GetRequiredFeature<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.Http (2)
Internal\DefaultHttpResponse.cs (1)
72var otherFeature = _features.Collection.GetRequiredFeature<IHttpResponseBodyFeature>();
Internal\ResponseCookies.cs (1)
26Headers = _features.GetRequiredFeature<IHttpResponseFeature>().Headers;
Microsoft.AspNetCore.Http.Connections (2)
Internal\HttpConnectionDispatcher.cs (1)
714var existingRequestFeature = context.Features.GetRequiredFeature<IHttpRequestFeature>();
Internal\Transports\ServerSentEventsServerTransport.cs (1)
38var bufferingFeature = context.Features.GetRequiredFeature<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.Http.Extensions (2)
ResponseExtensions.cs (1)
27response.HttpContext.Features.GetRequiredFeature<IHttpResponseFeature>().ReasonPhrase = null;
SendFileResponseExtensions.cs (1)
116var sendFile = response.HttpContext.Features.GetRequiredFeature<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.Mvc.Core (1)
Filters\MiddlewareFilterBuilder.cs (1)
64var feature = httpContext.Features.GetRequiredFeature<IMiddlewareFilterFeature>();
Microsoft.AspNetCore.Rewrite (1)
UrlActions\CustomResponseAction.cs (1)
29context.HttpContext.Features.GetRequiredFeature<IHttpResponseFeature>().ReasonPhrase = StatusReason;
Microsoft.AspNetCore.Server.IIS (1)
Core\IISServerAuthenticationHandlerInternal.cs (1)
60_iisHttpContext = context.Features.GetRequiredFeature<IISHttpContext>();
Microsoft.AspNetCore.Server.Kestrel.Core (16)
Internal\Http3\Http3Connection.cs (2)
60_errorCodeFeature = context.ConnectionFeatures.GetRequiredFeature<IProtocolErrorCodeFeature>(); 588streamContext.Features.GetRequiredFeature<IProtocolErrorCodeFeature>().Error = (long)Http3ErrorCode.RequestRejected;
Internal\Http3\Http3ControlStream.cs (3)
47_streamIdFeature = context.ConnectionFeatures.GetRequiredFeature<IStreamIdFeature>(); 48_streamClosedFeature = context.ConnectionFeatures.GetRequiredFeature<IStreamClosedFeature>(); 49_errorCodeFeature = context.ConnectionFeatures.GetRequiredFeature<IProtocolErrorCodeFeature>();
Internal\Http3\Http3Stream.cs (4)
91_errorCodeFeature = _context.ConnectionFeatures.GetRequiredFeature<IProtocolErrorCodeFeature>(); 92_streamIdFeature = _context.ConnectionFeatures.GetRequiredFeature<IStreamIdFeature>(); 93_streamAbortFeature = _context.ConnectionFeatures.GetRequiredFeature<IStreamAbortFeature>(); 94_streamClosedFeature = _context.ConnectionFeatures.GetRequiredFeature<IStreamClosedFeature>();
Internal\WebTransport\WebTransportStream.cs (2)
52var streamIdFeature = context.ConnectionFeatures.GetRequiredFeature<IStreamIdFeature>(); 69var streamId = localContext.ConnectionFeatures.GetRequiredFeature<IStreamIdFeature>().StreamId;
Middleware\ConnectionLimitMiddleware.cs (1)
38_metrics.ConnectionRejected(connection.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext);
Middleware\HttpConnectionMiddleware.cs (1)
32var metricContext = connectionContext.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext;
Middleware\HttpMultiplexedConnectionMiddleware.cs (1)
33var metricContext = connectionContext.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext;
Middleware\HttpsConnectionMiddleware.cs (2)
158var metricsContext = context.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext; 352_metrics.TlsHandshakeStart(context.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
233var metricsContext = MultiplexedConnectionContext.Features.GetRequiredFeature<IConnectionMetricsContextFeature>().MetricsContext;
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
RedisHubLifetimeManager.cs (3)
129var feature = connection.Features.GetRequiredFeature<IRedisFeature>(); 304var feature = connection.Features.GetRequiredFeature<IRedisFeature>(); 335var feature = connection.Features.GetRequiredFeature<IRedisFeature>();
Microsoft.AspNetCore.StaticAssets (1)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
43var originalFeature = context.Features.GetRequiredFeature<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.TestHost (2)
ClientHandler.cs (1)
213response.ReasonPhrase = httpContext.Features.GetRequiredFeature<IHttpResponseFeature>().ReasonPhrase;
HttpContextBuilder.cs (1)
237var serverResponseFeature = _httpContext.Features.GetRequiredFeature<IHttpResponseFeature>();
Microsoft.Extensions.Features.Tests (2)
FeatureCollectionExtensionsTests.cs (2)
20var retrievedThing = features.GetRequiredFeature<IThing>(); 36Assert.Throws<InvalidOperationException>(() => features.GetRequiredFeature<object>());
WebTransportInteractiveSampleApp (2)
Program.cs (2)
56var feature = context.Features.GetRequiredFeature<IHttpWebTransportFeature>(); 77direction = stream.Features.GetRequiredFeature<IStreamDirectionFeature>();
WebTransportSampleApp (1)
Program.cs (1)
26var feature = context.Features.GetRequiredFeature<IHttpWebTransportFeature>();