-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Support HubMethodNameAttribute inheritance for DefaultHubDispatcher. #64818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for your PR, @@paulomorgado. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for inheriting the HubMethodNameAttribute in the DefaultHubDispatcher by modifying the attribute lookup to use inherit: true. This change ensures that when a hub method in a derived class overrides a base class method that has a HubMethodNameAttribute, the attribute is properly inherited.
- Modified
GetCustomAttribute<HubMethodNameAttribute>to useinherit: trueparameter, making it consistent with howAuthorizeAttributeis already handled - Added comprehensive test coverage for
[FromService]attribute functionality with various parameter combinations - Reorganized and added hub test methods in
ServicesHubto support the new tests
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/SignalR/server/Core/src/Internal/DefaultHubDispatcher.cs | Added inherit: true parameter to GetCustomAttribute<HubMethodNameAttribute> call to enable attribute inheritance from base classes |
| src/SignalR/server/SignalR/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTests.cs | Added 10 new test methods for [FromService] attribute scenarios and reorganized using statements |
| src/SignalR/server/SignalR/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTestUtils/Hubs.cs | Added and reorganized hub methods in ServicesHub to support testing of service injection with attributes |
src/SignalR/server/SignalR/test/Microsoft.AspNetCore.SignalR.Tests/HubConnectionHandlerTests.cs
Outdated
Show resolved
Hide resolved
…ests/HubConnectionHandlerTests.cs Co-authored-by: Copilot <[email protected]>
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
Support HubMethodNameAttribute inheritance for DefaultHubDispatcher
Fixes #64291