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

Define handlers for status codes with UseStatusCodePages #357

Closed
jchannon opened this issue Apr 12, 2017 · 2 comments
Closed

Define handlers for status codes with UseStatusCodePages #357

jchannon opened this issue Apr 12, 2017 · 2 comments

Comments

@jchannon
Copy link

In Nancy you can implement a IStatusCodeHandler which has CanHandle and a Handle methods. CanHandle returns a boolean that says for this statuscode I can handle it and then in the Handle it writes a response.

In UseStatusCodePages it seems to be a global filter for status codes. How do I say only execute x when the statuscode is y. Only examples I have seen is to write a Controller method that has a switch statement on the statuscode and that is very ugly.

Is there a cleaner way of doing it? If not could we make it cleaner?

@Eilon Eilon added this to the Backlog milestone Jun 6, 2017
@Eilon
Copy link
Contributor

Eilon commented Jun 6, 2017

Seems like an interesting idea, but no current plans to implement this.

@aspnet-hello
Copy link

This issue was moved to dotnet/aspnetcore#2589

@aspnet aspnet locked and limited conversation to collaborators Jan 2, 2018
@aspnet-hello aspnet-hello removed this from the Backlog milestone Jan 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants