diff --git a/samples/MvcSample.Web/HomeController.cs b/samples/MvcSample.Web/HomeController.cs index 09c3790ba0..916a81639c 100644 --- a/samples/MvcSample.Web/HomeController.cs +++ b/samples/MvcSample.Web/HomeController.cs @@ -151,7 +151,7 @@ namespace MvcSample.Web public void Raw() { - Context.Response.WriteAsync("Hello World raw"); + HttpContext.Response.WriteAsync("Hello World raw"); } public ActionResult Language() diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs index 8bf76d9649..c8d2157b15 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs @@ -45,9 +45,9 @@ namespace Microsoft.AspNet.Mvc } /// - /// Gets the for the executing action. + /// Gets the for the executing action. /// - public HttpContext Context + public HttpContext HttpContext { get { @@ -206,7 +206,7 @@ namespace Microsoft.AspNet.Mvc { get { - return Context?.User; + return HttpContext?.User; } } diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ControllerUnitTestabilityTests.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ControllerUnitTestabilityTests.cs index 17711c465a..8e8a3c1ba8 100644 --- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ControllerUnitTestabilityTests.cs +++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ControllerUnitTestabilityTests.cs @@ -502,7 +502,7 @@ namespace Microsoft.AspNet.Mvc controller.ActionContext = actionContext; // Assert - Assert.Equal(actionContext.HttpContext, controller.Context); + Assert.Equal(actionContext.HttpContext, controller.HttpContext); Assert.Equal(actionContext.RouteData, controller.RouteData); Assert.Equal(actionContext.ModelState, controller.ModelState); } @@ -528,7 +528,7 @@ namespace Microsoft.AspNet.Mvc controller.ActionContext = actionContext; // Assert - Assert.Equal(httpContext.Object, controller.Context); + Assert.Equal(httpContext.Object, controller.HttpContext); Assert.Equal(routeData.Object, controller.RouteData); Assert.Equal(actionContext.ModelState, controller.ModelState); Assert.Equal(actionDescriptor.Object, actionContext.ActionDescriptor); diff --git a/test/WebSites/ActivatorWebSite/Controllers/RegularController.cs b/test/WebSites/ActivatorWebSite/Controllers/RegularController.cs index 621c454bd6..79b0c24c33 100644 --- a/test/WebSites/ActivatorWebSite/Controllers/RegularController.cs +++ b/test/WebSites/ActivatorWebSite/Controllers/RegularController.cs @@ -14,7 +14,7 @@ namespace ActivatorWebSite // This verifies that ModelState and Context are activated. if (ModelState.IsValid) { - await Context.Response.WriteAsync("Hello world"); + await HttpContext.Response.WriteAsync("Hello world"); } return new EmptyResult(); diff --git a/test/WebSites/HtmlGenerationWebSite/Controllers/Catalog_CacheTagHelperController.cs b/test/WebSites/HtmlGenerationWebSite/Controllers/Catalog_CacheTagHelperController.cs index 68a9810436..9153730355 100644 --- a/test/WebSites/HtmlGenerationWebSite/Controllers/Catalog_CacheTagHelperController.cs +++ b/test/WebSites/HtmlGenerationWebSite/Controllers/Catalog_CacheTagHelperController.cs @@ -60,7 +60,7 @@ namespace HtmlGenerationWebSite.Controllers var identity = new ClaimsIdentity(); identity.AddClaim(new Claim(ClaimsIdentity.DefaultNameClaimType, id)); - Context.User = new ClaimsPrincipal(identity); + HttpContext.User = new ClaimsPrincipal(identity); ViewData["CorrelationId"] = correlationId; return View(); }