Skip to content

Generated safe routes #135

@Atulin

Description

@Atulin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions