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
Scrutor.MissingTypeRegistrationException: Could not find any registered services for type 'WebApi.Infrastructure.Repositories.IReadRepository<TEntity, TResponse>'
Yeah, decorating open generic types isn't supported very well for the reasons outlined here.
It's partly supported by having fully closed registrations in the collection (i.e. by scanning using IsAssignableTo and AsImplementedInterfaces) before decorating. In that case it will use the type arguments of the closed services to "fill in" the arguments of the decorators services.
That's unfortunately as far as we'll get with the built-in container 😞
Activity
khellang commentedon Feb 28, 2021
Yeah, decorating open generic types isn't supported very well for the reasons outlined here.
It's partly supported by having fully closed registrations in the collection (i.e. by scanning using
IsAssignableToandAsImplementedInterfaces) before decorating. In that case it will use the type arguments of the closed services to "fill in" the arguments of the decorators services.That's unfortunately as far as we'll get with the built-in container 😞
rakhimzhanov commentedon Mar 1, 2021
Dear khellang,
Thanks for the answer and your wonderful library.
Hope we will have this feature in the future.