You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 2, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 2, 2018. It is now read-only.
Consider lifting requirement to register open generic types by type #450
When working on decoration in Scrutor, I noticed that there's an exception being thrown if you try to register an open generic type using a factory function.
What's the reasoning behind this? Is it just an oversight?
They way I've implemented the decoration is by chaining together ServiceDescriptors using a combination of factory functions and ActivatorUtilities, but by having this limitation in place, I can't register a factory function for open generics.
Actually, after doing this work myself and digging a bit deeper, I realized this won't work anyway, cause there's no way to know the actual type being requested in a factory function.
That means I can't get the generic arguments of the concrete service type being requested 😞
I don't see a way this can be solved, without changing the signature of the factory delegate to include more information...
Activity
khellang commentedon Sep 9, 2016
Actually, after doing this work myself and digging a bit deeper, I realized this won't work anyway, cause there's no way to know the actual type being requested in a factory function.
That means I can't get the generic arguments of the concrete service type being requested 😞
I don't see a way this can be solved, without changing the signature of the factory delegate to include more information...