Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
Renamed Controller.Context to Controller.HttpContext
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaybhargavb committed Sep 25, 2015
1 parent 5a80435 commit 9c81b95
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion samples/MvcSample.Web/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public ActionResult Hello()

public void Raw()
{
Context.Response.WriteAsync("Hello World raw");
HttpContext.Response.WriteAsync("Hello World raw");
}

public ActionResult Language()
Expand Down
6 changes: 3 additions & 3 deletions src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public IServiceProvider Resolver
}

/// <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
{
Expand Down Expand Up @@ -206,7 +206,7 @@ public ClaimsPrincipal User
{
get
{
return Context?.User;
return HttpContext?.User;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ public void ActionContextDefaultConstructor_CanBeUsedForControllerActionContext(
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);
}
Expand All @@ -528,7 +528,7 @@ public void ActionContextSetters_CanBeUsedWithControllerActionContext()
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public async Task<EmptyResult> Index()
// 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public IActionResult PastPurchases(string id, int correlationId)
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();
}
Expand Down

0 comments on commit 9c81b95

Please sign in to comment.