75 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";
HtmlGenerationWebSite (1)
Controllers\Catalog_CacheTagHelperController.cs (1)
61
HttpContext
.User = new ClaimsPrincipal(identity);
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
);
Mvc.RoutingWebSite (29)
Areas\Admin\LG3Controller.cs (2)
25
return _linkGenerator.GetPathByAction(
HttpContext
, action: nameof(SomeAction));
37
HttpContext
,
Controllers\ConventionalControllerWithMetadata.cs (1)
14
return Ok(
HttpContext
.GetEndpoint().Metadata.GetOrderedMetadata<MetadataAttribute>().Select(m => m.Value));
Controllers\EndpointNameController.cs (2)
24
return _generator.GetPathByName(
HttpContext
, "EndpointNameController_LinkToAttributeRouted", values: null);
29
return _generator.GetPathByName(
HttpContext
, "RouteWithOptionalSegment", new { controller = "EndpointName", action = nameof(LinkToConventionalRouted), });
Controllers\ItemsController.cs (2)
13
return Ok(
HttpContext
.Items);
24
return Ok(
HttpContext
.Items);
Controllers\LG1Controller.cs (20)
19
return _linkGenerator.GetPathByAction(
HttpContext
, values: QueryToRouteValues(
HttpContext
.Request.Query));
25
HttpContext
,
27
values: QueryToRouteValues(
HttpContext
.Request.Query));
33
HttpContext
,
36
values: QueryToRouteValues(
HttpContext
.Request.Query));
41
var values = QueryToRouteValues(
HttpContext
.Request.Query);
45
HttpContext
,
54
HttpContext
,
56
values: QueryToRouteValues(
HttpContext
.Request.Query));
62
HttpContext
,
64
values: QueryToRouteValues(
HttpContext
.Request.Query));
69
var values = QueryToRouteValues(
HttpContext
.Request.Query);
72
HttpContext
,
81
HttpContext
,
84
values: QueryToRouteValues(
HttpContext
.Request.Query),
91
HttpContext
,
93
values: QueryToRouteValues(
HttpContext
.Request.Query));
103
values: QueryToRouteValues(
HttpContext
.Request.Query),
109
var values = QueryToRouteValues(
HttpContext
.Request.Query);
Controllers\LinkParserController.cs (1)
20
var parsed = _linkParser.ParsePathByEndpointName("default",
HttpContext
.Request.Path);
Controllers\RoutingController.cs (1)
13
var endpointFeature =
HttpContext
.Features.Get<IEndpointFeature>();
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>();