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

Review IActionResult classes and add facades as necessary #4207

Closed
rynowak opened this issue Mar 2, 2016 · 2 comments
Closed

Review IActionResult classes and add facades as necessary #4207

rynowak opened this issue Mar 2, 2016 · 2 comments
Assignees
Milestone

Comments

@rynowak
Copy link
Member

rynowak commented Mar 2, 2016

We still have some IActionResult classes like ViewComponentResult that have a lot of implementation code in their execute method, including calls to GetRequiredService. We should review these and change them to be more like ViewResult.

@Eilon
Copy link
Member

Eilon commented May 22, 2016

@javiercn have we made much progress on this? This is going to be a strong candidate to move out of v1.0.0...

@javiercn
Copy link
Member

I've gone through all the action results and I've examined what to do on each individual action result. My criteria for adding facades has been the following. The ActionResult is part of a "Result Hierarchy" like file related results (and one or more of them require more than one dependency from DI). There is a reasonable amount of code in the action result Execute* method.

In general I've left untouched the action results that just resolve a logger factory and do small work on the execute* method.

  • BadRequestObjectResult -> No changes required
  • BadRequestResult -> No changes required
  • ChallengeResult -> Not adding a facade for this, it just uses context.HttpContext.Authentication
  • ContentResult -> Not adding a facade for this, we might want to remove the buffering feature related code.
  • CreatedAtRouteResult -> Does an extra call to GetRequiredService, but they are hard to change due to the current layering, we can leave them as they are right now.
  • CreatedResult -> Does an extra call to GetRequiredService, but they are hard to change due to the current layering, we can leave them as they are right now.
  • EmptyResult -> No changes required
  • FileContentResult -> Added a facade for it
  • FileStreamResult -> Added a facade for it.
  • ForbidResult -> Not adding a facade for this, it just uses context.HttpContext.Authentication.
  • LocalRedirectResult -> Added a facade for it.
  • NoContentResult -> No changes required
  • NotFoundObjectResult -> No changes required
  • NotFoundResult -> No changes required
  • ObjectResult -> Already has a facade
  • OkObjectResult -> No changes required
  • OkResult -> No changes required
  • PhysicalFileResult -> Added a facade for it, removed the extensibility points on the result as they were meant for code reuse (which is now on the executor) and for unit testing.
  • RedirectResult -> Added a facade for it.
  • RedirectToActionResult -> Added a facade for it.
  • RedirectToRouteResult -> Added a facade for it.
  • SignInResult -> No changes required
  • SignOutResult -> No changes required
  • StatusCodeResult -> No changes required
  • UnauthorizedResult -> No changes required
  • UnsupportedMediaTypeResult -> No changes required
  • VirtualFileResult -> Added a facade for it
  • JsonResult -> Already has a facade
  • PartialViewResult -> Already has a facade
  • ViewComponentResult -> Added a facade for it
  • ViewResult -> Already has a facade

Results on the WebApiCompatShim

  • Not doing anything here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants