1 implementation of IHttpContextAccessor
Microsoft.AspNetCore.Http (1)
HttpContextAccessor.cs (1)
12public class HttpContextAccessor : IHttpContextAccessor
59 references to IHttpContextAccessor
BasicWebSite (3)
Filters\RequestIdService.cs (1)
9public RequestIdService(IServiceProvider services, IHttpContextAccessor contextAccessor)
StartupWithoutEndpointRouting.cs (2)
60var contextAccessor = serviceProvider.GetRequiredService<IHttpContextAccessor>();
ControllersFromServicesClassLibrary (1)
QueryValueService.cs (1)
12public QueryValueService(IHttpContextAccessor httpContextAccessor)
InProcessWebSite (2)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (2)
39private IHttpContextAccessor _httpContextAccessor; 41public void Configure(IApplicationBuilder app, IHttpContextAccessor httpContextAccessor)
Keycloak.Web (1)
AuthorizationHandler.cs (1)
6public class AuthorizationHandler(IHttpContextAccessor httpContextAccessor) : DelegatingHandler
Microsoft.AspNetCore.AsyncState (2)
AsyncContextHttpContext.cs (2)
14private readonly IHttpContextAccessor _httpContextAccessor; 18IHttpContextAccessor httpContextAccessor)
Microsoft.AspNetCore.AsyncState.Tests (3)
AsyncContextHttpContextOfTTests.cs (2)
14private readonly IHttpContextAccessor _accessorMock; 25_accessorMock = serviceProvider.GetRequiredService<IHttpContextAccessor>();
AsyncStateHttpContextExtensionsTests.cs (1)
28var serviceDescriptor = services.First(x => x.ServiceType == typeof(IHttpContextAccessor));
Microsoft.AspNetCore.Diagnostics.Middleware (2)
Logging\RequestHeadersLogEnricher.cs (2)
23private readonly IHttpContextAccessor _httpContextAccessor; 32public RequestHeadersLogEnricher(IHttpContextAccessor httpContextAccessor, IOptions<RequestHeadersLogEnricherOptions> options,
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Logging\RequestHeadersEnricherTests.cs (5)
31private readonly Mock<IHttpContextAccessor> _accessorMock; 51_accessorMock = new Mock<IHttpContextAccessor>(MockBehavior.Strict); 203var accessorMock = new Mock<IHttpContextAccessor>(MockBehavior.Strict); 236var accessorMock = new Mock<IHttpContextAccessor>(MockBehavior.Strict); 260var accessorMock = new Mock<IHttpContextAccessor>(MockBehavior.Strict);
Microsoft.AspNetCore.HeaderParsing (1)
HeaderParsingServiceCollectionExtensions.cs (1)
30.AddSingleton<IHttpContextAccessor, HttpContextAccessor>()
Microsoft.AspNetCore.Hosting (3)
Http\DefaultHttpContextFactory.cs (3)
19private readonly IHttpContextAccessor? _httpContextAccessor; 32_httpContextAccessor = serviceProvider.GetService<IHttpContextAccessor>(); 37internal IHttpContextAccessor? HttpContextAccessor => _httpContextAccessor;
Microsoft.AspNetCore.Hosting.Tests (4)
Http\DefaultHttpContextFactoryTests.cs (4)
19var accessor = services.GetRequiredService<IHttpContextAccessor>(); 37var accessor = services.GetRequiredService<IHttpContextAccessor>();
Microsoft.AspNetCore.Http (3)
HttpContextAccessor.cs (1)
9/// Provides an implementation of <see cref="IHttpContextAccessor" /> based on the current execution context.
HttpServiceCollectionExtensions.cs (2)
15/// Adds a default implementation for the <see cref="IHttpContextAccessor"/> service. 23services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
Microsoft.AspNetCore.Identity (4)
AspNetRoleManager.cs (1)
31IHttpContextAccessor contextAccessor)
AspNetUserManager.cs (1)
42_cancel = services?.GetService<IHttpContextAccessor>()?.HttpContext?.RequestAborted ?? CancellationToken.None;
SignInManager.cs (2)
24private readonly IHttpContextAccessor _contextAccessor; 41IHttpContextAccessor contextAccessor,
Microsoft.AspNetCore.Identity.InMemory.Test (2)
ControllerTest.cs (2)
29var contextAccessor = new Mock<IHttpContextAccessor>(); 81var contextAccessor = new Mock<IHttpContextAccessor>();
Microsoft.AspNetCore.Identity.Test (15)
IdentityBuilderTest.cs (1)
396public MySignInManager(UserManager<PocoUser> manager, IHttpContextAccessor context, IUserClaimsPrincipalFactory<PocoUser> claimsFactory) : base(manager, context, claimsFactory, null, null, null, null) { }
SecurityStampValidatorTest.cs (6)
103var contextAccessor = new Mock<IHttpContextAccessor>(); 166var contextAccessor = new Mock<IHttpContextAccessor>(); 207var contextAccessor = new Mock<IHttpContextAccessor>(); 246var contextAccessor = new Mock<IHttpContextAccessor>(); 283var contextAccessor = new Mock<IHttpContextAccessor>(); 331var contextAccessor = new Mock<IHttpContextAccessor>();
SignInManagerTest.cs (8)
24var contextAccessor = new Mock<IHttpContextAccessor>(); 40var contextAccessor = new Mock<IHttpContextAccessor>(); 70var contextAccessor = new Mock<IHttpContextAccessor>(); 102var contextAccessor = new Mock<IHttpContextAccessor>(); 1281var contextAccessor = new Mock<IHttpContextAccessor>(); 1301IHttpContextAccessor contextAccessor, 1313IHttpContextAccessor contextAccessor, 1330IHttpContextAccessor contextAccessor,
Microsoft.AspNetCore.TestHost.Tests (6)
TestServerTests.cs (6)
579var accessor = app.ApplicationServices.GetRequiredService<IHttpContextAccessor>(); 585services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); 595public ContextHolder(IHttpContextAccessor accessor) 600public IHttpContextAccessor Accessor { get; set; } 616services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
ServerComparison.TestSites (2)
OneTransformPerRequest.cs (2)
14public OneTransformPerRequest(IHttpContextAccessor contextAccessor) 19public IHttpContextAccessor ContextAccessor { get; }