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