Skip to content

Support Controller suffix in MapControllerRoute #27204

Open
@davidfowl

Description

@davidfowl

This would allow MapControllerRoute to be used with nameof more seamlessly:

Today we have to do something like this:

endpoints.MapControllerRoute("name", "/{**path}", defaults: new
{
    controller = nameof(HomeController).Replace("Controller", ""),
    action = nameof(HomeController.Hello)
});

This would be better:

endpoints.MapControllerRoute("name", "/{**path}", defaults: new
{
    controller = nameof(HomeController),
    action = nameof(HomeController.Hello)
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-mediumThis issue impacts approximately half of our customersarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-routingseverity-minorThis label is used by an internal tool

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions