Skip to content

How do I get the whole route collection in an Action Filter? #1323

Closed
@brainwipe

Description

@brainwipe

I am working on a .NET core implementation of the hypermedia JSONApi standard. I need to generate the hypermedia links, for which I need the route dictionary (to use old terms).

A custom ActionFilterAttribute is added as a global service, and performs the custom transform on OnActionExecuted. I want to hand the custom transformer a route collection so that it can work out the URIs to the actions it needs. These actions could be in other controllers not part of the request.

I believe that this will be done by dependency injecting a service (or Application Model?) into the constructor but I cannot find the relevant service to inject.

How do I get the route collection in the action filter?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions