45 references to HttpContext
BasicWebSite (3)
Controllers\ContentNegotiation\InvalidContentTypeController.cs (1)
13HttpContext.Response.ContentType = "json";
Controllers\RoutingController.cs (1)
13var endpointFeature = HttpContext.Features.Get<IEndpointFeature>();
Controllers\TempDataController.cs (1)
122HttpContext.Features.Get<ITrackingConsentFeature>().GrantConsent();
ClaimsTransformation (3)
Controllers\AccountController.cs (2)
42await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme, "user", "role"))); 59await HttpContext.SignOutAsync();
Controllers\HomeController.cs (1)
26return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
Cookies (3)
Controllers\AccountController.cs (2)
41await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "role"))); 63await HttpContext.SignOutAsync();
Controllers\HomeController.cs (1)
26return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
CustomPolicyProvider (2)
Controllers\AccountController.cs (2)
39await HttpContext.SignInAsync(new ClaimsPrincipal(identity)); 46await HttpContext.SignOutAsync();
FormatterWebSite (1)
Controllers\SystemTextJsonOutputFormatterController.cs (1)
26HttpContext.Response.Headers["Test"] = "t";
IdentitySample.Mvc (2)
Controllers\AccountController.cs (1)
547return _userManager.GetUserAsync(HttpContext.User);
Controllers\ManageController.cs (1)
373return _userManager.GetUserAsync(HttpContext.User);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Logging\ApiRoutingController.cs (1)
31var fakeTimeProvider = HttpContext.RequestServices.GetRequiredService<FakeTimeProvider>();
Microsoft.AspNetCore.Mvc.Core (10)
ControllerBase.cs (10)
42public HttpRequest Request => HttpContext?.Request!; 47public HttpResponse Response => HttpContext?.Response!; 97_metadataProvider = HttpContext?.RequestServices?.GetRequiredService<IModelMetadataProvider>(); 120_modelBinderFactory = HttpContext?.RequestServices?.GetRequiredService<IModelBinderFactory>(); 143var factory = HttpContext?.RequestServices?.GetRequiredService<IUrlHelperFactory>(); 167_objectValidator = HttpContext?.RequestServices?.GetRequiredService<IObjectModelValidator>(); 190_problemDetailsFactory = HttpContext?.RequestServices?.GetRequiredService<ProblemDetailsFactory>(); 206public ClaimsPrincipal User => HttpContext?.User!; 1882HttpContext, 2004HttpContext,
Microsoft.AspNetCore.Mvc.Core.Test (1)
ControllerBaseTest.cs (1)
3001var innerServiceProvider = controller.HttpContext?.RequestServices;
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
Controller.cs (2)
71var factory = HttpContext?.RequestServices?.GetRequiredService<ITempDataDictionaryFactory>(); 72_tempData = factory?.GetTempData(HttpContext);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
ControllerUnitTestabilityTests.cs (2)
585Assert.Equal(controllerContext.HttpContext, controller.HttpContext); 611Assert.Same(httpContext, controller.HttpContext);
MvcFormSample (1)
Controllers\HomeController.cs (1)
48return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
Negotiate.Server (2)
Controllers\AuthController.cs (2)
17var user = HttpContext.User.Identity; 30var user = HttpContext.User.Identity;
PathSchemeSelection (3)
Controllers\AccountController.cs (2)
42await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "role"))); 64await HttpContext.SignOutAsync();
Controllers\HomeController.cs (1)
26return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
SecurityWebSite (5)
Controllers\AdministrationController.cs (2)
25var countEvaluator = (CountingPolicyEvaluator)HttpContext.RequestServices.GetRequiredService<IPolicyEvaluator>(); 38await HttpContext.SignInAsync("Cookie2", new ClaimsPrincipal(new ClaimsIdentity("Cookie2")));
Controllers\LoginController.cs (3)
19await HttpContext.SignInAsync(scheme: null, new ClaimsPrincipal(identity)); 27await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity)); 35await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(identity));
StaticFilesAuth (3)
Controllers\AccountController.cs (2)
41await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "role"))); 63await HttpContext.SignOutAsync();
Controllers\HomeController.cs (1)
24return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
VersioningWebSite (1)
Controllers\RoutingController.cs (1)
13var endpointFeature = HttpContext.Features.Get<IEndpointFeature>();