-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SignalR] Error if multiple service attributes are on a single parameter #50248
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
Conversation
| { | ||
| if (marked) | ||
| { | ||
| throw new InvalidOperationException( |
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.
Maybe we should unify this with the exceptions throw in MVC/minimal APIs?
RE:
| throw new NotSupportedException( |
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.
That one doesn't mention which method is the culprit, maybe because it can be an unnamed delegate?
I'd like to keep the name for SignalR so it's very clear where the issue is. Maybe just add it at the beginning:
"{methodExecutor.MethodInfo.FullName}: The {nameof(FromKeyedServicesAttribute)} is not supported on parameters that are also annotated with {nameof(IFromServiceMetadata)}."
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.
Updated the exception message
|
LGTM, is it ready for merge? |
|
Yeah |
Also throw if the
ServiceProviderdoesn't support keyed services.Recommend reviewing with whitespace hidden: https://github.com/dotnet/aspnetcore/pull/50248/files?diff=split&w=1