Support Controller suffix in MapControllerRoute
Open
affected-medium
area-mvc
enhancement
feature-routing
severity-minor
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
This would allow MapControllerRoute to be used with nameof more seamlessly:
Today we have to do something like this:
```C#
endpoints.MapControllerRoute("name", "/{**path}", defaults: new
{
controller = nameof(HomeController).Replace("Controller", ""),
action = nameof(HomeController.Hello)
});
```
This would be better:
```c#
endpoints.MapControllerRoute("name", "/{**path}", defaults: new
{
controller = nameof(HomeController),
action = nameof(HomeController.Hello)
});
```
Contributor guide
Assessment
This issue has not been assessed yet.