-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
How to scan and decorate an open generic interface used multiple times? #68
Comments
This is more or less what I'm doing in my unit tests, so I think it should be a supported scenario; Scrutor/test/Scrutor.Tests/OpenGenericDecorationTests.cs Lines 28 to 41 in 195006f
I'll have to look into it a bit more. In the meantime, I'd appreciate a bit more details than just "it doesn't work" 😉 |
Hmm. You're registering types |
I am currently setting up an example project, but in your code you explicitly register a queryhandler, while i would like to register all of them automatically. And the |
Here's my example project: The error I get now:
This is my code for registering my commandhandlers and decorators:
I hope you can help me out here ^^' |
I am observing the exact same issue with versions > 2.1.2. Version 2.1.2 is working fine using open-generics. |
Hey everyone, I managed to get my example to work! The fix is as follows:
The difference between this bit and the one in my example zip is that now only the commandhandlers that are NOT generic are registered. In my old example the commandhandlers AND the decorators were registered. The decorators are open generic types but the commandhandlers are closed. That is why the I hope this helps someone! |
Hello!
Let me start of by asking if my issue is possibly related to #39 , cuz I feel like it might be.
I discovered your project and I really like the possibilities it offers. I am having a tough time trying to get a functionality to work and I'd love to know if I am able to do this or not. (If I can, I'd like to know how)
My project uses commands and queries, and those commands are decorated. My controller has instances of these command/query handlers. When executing the commands, I'd like the decorators to be executed first, in order, until the actual commandhandler is executed.
A little overview of what I would like to accomplish:
Each command would have the following:
Sadly, I can't get this to work! At the moment of writing I can not tell you the exact errors I am getting, but I think that my scenario isn't possible.
If it is, please tell me what I am doing wrong!
If it is not possible, what would be a good container to get this to work anyway? I have some experience with autofac.
The text was updated successfully, but these errors were encountered: