-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Add an extension method Users to IHubClients witch takes IEnumerable parameter #17360
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
abd2cc1
to
500ab60
Compare
We should add this to all the client methods if we're going to do it (Groups, GroupsExcept, etc. etc. etc.). Also, we need to discuss if an extension method is right or if we should use a Default Interface Member. The latter would allow an implementation to override it and provide different logic for Thoughts on this @davidfowl @halter73 @BrennanConroy ? |
I agree we should do the same for Groups, GroupsExcept, etc... I think for something as trivial as this, an extension method is still appropriate. I don't know why an interface implementor would want to do anything special for |
Can anybody suggest how to fix build and what is Pull Request Labeler? |
@aspnet/asp-net-api-reviews We'll want to do an API review on this before merging. I wouldn't worry about the PR labeler. That doesn't block the build. I don't even think it's supposed to run for external PRs (#15171) @mkArtakMSFT Do you know what's going on here? |
Thanks, |
Have you enabled the "Use previews of the .NET Core SDK" checkbox as suggested in that doc? Even if you can't fully build, you may still be able to run the script @halter73 mentioned to update the ref assembly. Updating that is necessary to resolve the Code Check failure. |
thanks, |
Excellent! Thanks! A note here about the process from here:
Once we've got those done, we'll merge it in! |
c8418b9
to
4a2103a
Compare
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.
We want to make sure this isn't a source breaking change
Specifically we should make sure that using array or list here doesn't lead to an ambiguity compiler diagnostic. |
I tried this with an Array, List and IEnumerable (which was really an Array stored as an IEnumerable). Since both Array and List implement IReadOnlyList and IReadOnlyList inherits from IEnumerable, the compiler chooses the more-derived IReadOnlyList overload. In the IEnumerable case, the compiler chooses the IEnumerable extension method since that's the only workable overload. Overload selection is a compile-time decision, so an Array/List/whatever can still be passed to the IEnumerable extension method if the compiler only knows it's an IEnumerable, but I don't see a problem with that. |
Thanks @Marusyk. |
Add a simple extension method toIHubClients witch takes IEnumerable parameter
Addresses #17285
Please review
Thank you in advance