Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated safe routes #135

Open
Atulin opened this issue Dec 3, 2024 · 0 comments
Open

Generated safe routes #135

Atulin opened this issue Dec 3, 2024 · 0 comments

Comments

@Atulin
Copy link

Atulin commented Dec 3, 2024

Inspired by https://github.com/daviddotcs/safe-routing

Currently, to get a route to a given endpoint, we must rely either on magic strings, or the endpoint must be given a name for use with link generator or redirect response.

The routes, at least, could be source-generated, and perhaps available as a static property of the handler. For example, GetAllBooks.Route.

As a step above that, and a step towards the safe-routing way, a whole redirect result object could be created, so that return TypedResults.Redirect(nameof(GetAllBooks)) or similar can be replaced with return GetAllBooks.Redirect or some such.

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

No branches or pull requests

1 participant