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

Add IActionResults factory methods to Page and PageModel #5846

Closed
rynowak opened this issue Feb 22, 2017 · 4 comments
Closed

Add IActionResults factory methods to Page and PageModel #5846

rynowak opened this issue Feb 22, 2017 · 4 comments

Comments

@rynowak
Copy link
Member

rynowak commented Feb 22, 2017

We have support for returning IActionResult from a page or pagemodel, but we haven't yet ported over the API surface that users need.

This item tracks adding boilerplate for things we already have, not inventing new action results or factory methods which will be tracked separately.


I've done the gap analysis here between Controller/ControllerBase and Page/Page model:

TLDR here's what to do....

Add the following to Page

Challenge
Content
Forbid
File
LocalRedirect
NotFound
PhysicalFile
Redirect (missing some of the variations for preservemethod)
RedirectToAction
RedirectToRoute
SignIn
SignOut
StatusCode
Unauthorized

Add the following to PageModel

Challenge
Content
Forbid
File
LocalRedirect
NotFound
PhysicalFile
Redirect (missing some of the variations for preservemethod)
RedirectToAction
RedirectToRoute
SignIn
SignOut
StatusCode
Unauthorized


My notes...

All Methods on Controller/ControllerBase

Accepted
AcceptedAtAction
AcceptedAtRoute
BadRequest
Challenge
Content
Created
CreatedAtAction
CreatedAtRoute
File
Forbid
Json
LocalRedirect
NoContent
NotFound
Ok
PartialView
PhysicalFile
Redirect
RedirectToAction
RedirectToRoute
SignIn
SignOut
StatusCode
Unauthorized
View
ViewComponent

All of the Redirect kinds have 4 Permanent/PreserveMethod variations - I'm not going to repeat that detail everywhere 👍

Methods Pages Should Have

Challenge
Content
Forbid
File
LocalRedirect
NotFound
PhysicalFile
Redirect
RedirectToAction
RedirectToRoute
SignIn
SignOut
StatusCode
Unauthorized

Including the authorization-related stuff here because we will eventually add it if we don't today. The things that aren't added are the HTTP/API related helpers, legacy things like JSON and View-related stuff

Methods Pages Don't Need

Accepted
AcceptedAtAction
AcceptedAtRoute
BadRequest
Created
CreatedAtAction
CreatedAtRoute
Json
NoContent
Ok
PartialView
View
ViewComponent

@Eilon
Copy link
Member

Eilon commented Mar 13, 2017

@ryanbrandenburg adding to your plate.

@ryanbrandenburg
Copy link
Contributor

ryanbrandenburg commented Apr 12, 2017

Turning your lists into checklists for me to keep track with while getting waylaid by build buddy stuff.

Add the following to Page:

  • Challenge
  • Content
  • Forbid
  • File
  • LocalRedirect
  • NotFound
  • PhysicalFile
  • Redirect (missing some of the variations for preservemethod)
  • RedirectToAction
  • RedirectToRoute
  • SignIn
  • SignOut
  • StatusCode
  • Unauthorized

Add the following to PageModel:

  • Challenge
  • Content
  • Forbid
  • File
  • LocalRedirect
  • NotFound
  • PhysicalFile
  • Redirect (missing some of the variations for preservemethod)
  • RedirectToAction
  • RedirectToRoute
  • SignIn
  • SignOut
  • StatusCode
  • Unauthorized

@ryanbrandenburg
Copy link
Contributor

Methods Pages Don't Need... View

View already exists on PageModel and Page, I assume you mean that we don't need another copy of it?

@rynowak
Copy link
Member Author

rynowak commented Apr 12, 2017

The View on Page and PageModel renders the page. It's not the same as View, do not remove it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

No branches or pull requests

4 participants