Create or reuse route attribute for SignalR
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is your feature request related to a problem? Please describe.
Currently, the only way to specify the SignalR hub route is specifying in the `MapHub` method like:
```
app.UseEndpoints(endpoints =>
{
endpoints.MapHub("/someHub");
});
```
### Describe the solution you'd like
I think it could be used some attribute as we use in asp net core controllers `[Route("/someHub")]`, this way it would simplify MapHub method, having more consistency about the place to put the hub route (in this case would be in the Hub class). Also, it would allow us to scan for this route and write some custom documentation (ex: some swagger extension) about signalR hubs.
I know I can write that in my app, but it would be nice to have this built-in and it would be more consistent with aspnetcore controllers, maybe the same attribute could be used as well since signalR is part of aspnetcore now.
Thank you
Contributor guide
Assessment
This issue has not been assessed yet.