-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Generic Handler implementation only handles single generic argument and breaks existing implementations #1047
Comments
Gah. Care to submit a PR? |
@jbogard I have a fix for the above issue.. My only question is what limitations should be present? What I mean is, should we let the user define handlers that have 10 type parameters, each with no constraint? You can see how this could be problematic for the user, right? My solution is to allow more than one generic type parameter but throw errors if the max number of generic type params is exceeded OR the max number of concrete class combinations is exceed OR if a timeout occurs. My question is.. what should those limitations be? I'm also trying to figure out a way to test these scenarios since even defining a class that should throw an exception does so for all tests that call So, any discussion around this is welcome. I think I'm just going to create a PR and let discussion take place there. |
Is there a way to define a sensible limit internally, but then allow for this to be configurable? |
yes, I think there is a way to do this.. I will set up some configuration options with default values that can be overridden when calling |
This fix is on the MyGet feed: https://myget.org/gallery/mediatr-ci Can you verify that this fixes the issue? |
Yes the pre release packages are all on MyGet. I'll get a release out then. |
Fixed by #1048 |
Support for Generic Handlers has been added in v12.3.0 in this pr: #1013
However, this is not opt-in and only supports a single generic argument.
So a setup like this is incompatible:
Also rather than simply not matching these requests this throws an exception on startup meaning this can't even fallback to existing code I have to handle these more complex generic handlers.
I suggest:
The text was updated successfully, but these errors were encountered: