-
Notifications
You must be signed in to change notification settings - Fork 152
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
Resolving generic type with type argument that maps to multiple concrete types of other type argument fails #316
Comments
Okay, I'm currently looking in to this; I can't immediately see why this is going on. Running it through the debugger right now. Might be a bug. What I'm noticing is that if you change the registration of the open-generic In the meantime, to stall some time: why do you wish to implement two |
As far as I remember, you could remove the contrains from
As you might noticed, the structure is based upon your QueryHandler example. Because we mostly deliver data from the database we skipped the command part. Not happy with your naming we renamed Due to the havy use of time slices and other things we do not use an OR-Mapper to get everything but using database views and corresponding services. Starting with something like ReqMedia, ReqDocuments, ReqPrices, ReqBonus,... I noticed they often use the same properties. Especially in the beginning we forgot about filling some properties and mapping itself was kind of annoying und repetitive. Lukily SimpleInjector is quite flexible and allows me to say I like a service which accepts a ProduktId as input and gives me all media and the next time I like a service which accepts a ProduktId as input and gives me all prices and so on... I also start switching from using classes for the request to get-only-interfaces to get rid of the frequent property mapping. From architectural point of view the |
Yes, I noticed. After copying your code to a console application, I renamed all classes and interfaces to be able to make a mental model in my head.
Thumbs up 👍 for that. In general, I would advise against reusing a single But that said, what you are experiencing is a bug in Simple Injector. I traced it down to the internal |
After some thorough investigation, the fix wasn't actually that hard. I pushed v3.2.3 to Github and Nuget. This patch release should fix your problem. |
Thanks, works like a charm. |
Hi,
I had to change my project to use collections and found some strange behavoir. I wrote a small sample showing the problem. Everything is registered but Simple Injector keeps complaining and I do not know why. Depending on the order of the Interfaces in line
Req : IServiceRequest<ResponseA>, IServiceRequest<ResponseB>
the generation ofUseCase1
orUseCase2
fails.The call to
Verify()
fails with the following exception:Regards,
Christian
The text was updated successfully, but these errors were encountered: