Skip to content
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

VariantGenericTypesInResolvedCollection not enabled #674

Open
tal185072 opened this issue Jan 16, 2025 · 1 comment
Open

VariantGenericTypesInResolvedCollection not enabled #674

tal185072 opened this issue Jan 16, 2025 · 1 comment

Comments

@tal185072
Copy link

Hello

when I use the DryIocServiceProviderFactory it looks like the
VariantGenericTypesInResolvedCollection is disabled even when i enble it in the container ,
and if I use a container with Rules.Default DryIocServiceProviderFactory overwrites it to Rules.MicrosoftDependencyInjectionRules,
How can i enable the VariantGenericTypesInResolvedCollection option?

thank you

@dadhi
Copy link
Owner

dadhi commented Jan 16, 2025

VariantGenericTypesInResolvedCollection is conflicting with MS.DI container. But you may get DryIoc container from the services, change it rules and use it for resolution instead of the ServiceProvider.

var c = serviceProvider.GetService<DryIoc.IContainer>();
var newC = c.With(r => r.WithVariantGenericTypesInResolvedCollection());
var things = newC.ResolveMany<ISomeThing>();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants