Renamed Controller.Context to Controller.HttpContext

- #3165
This commit is contained in:
Ajay Bhargav Baaskaran 2015-09-24 11:07:50 -07:00
parent 5a80435534
commit 9c81b95d1b
5 changed files with 8 additions and 8 deletions

View File

@ -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()

View File

@ -45,9 +45,9 @@ namespace Microsoft.AspNet.Mvc
}
/// <summary>
/// Gets the <see cref="HttpContext"/> for the executing action.
/// Gets the <see cref="Http.HttpContext"/> for the executing action.
/// </summary>
public HttpContext Context
public HttpContext HttpContext
{
get
{
@ -206,7 +206,7 @@ namespace Microsoft.AspNet.Mvc
{
get
{
return Context?.User;
return HttpContext?.User;
}
}

View File

@ -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);

View File

@ -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();

View File

@ -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();
}