Skip to content

Add a result filter for razor pages #34

@haacked

Description

@haacked

Right now, there's no nice declarative way (that I could find) to add a feature flag to a razor page.

[FeatureGate(FeatureFlags.FeatureA)]
public class IndexModel : PageModel {...}

Doesn't work because FeatureGateAttribute only overrides OnActionExecutionAsync. I haven't tested this myself, but I believe if you also implement OnResultExecutingAsync you'll cover Razor pages. At least according to the docs Filter methods for Razor Pages in ASP.NET Core

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