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

[feature request] have more control over dependency overrides #165

Open
kicsiede opened this issue Apr 26, 2024 · 1 comment
Open

[feature request] have more control over dependency overrides #165

kicsiede opened this issue Apr 26, 2024 · 1 comment

Comments

@kicsiede
Copy link

It would be beneficial to have more precise control over passing dependency overrides, along with support for named bindings. Currently, our approach is as follows:

container.Resolve<Service>([ instance1, instance2... ])

In this setup, type overrides are automatically resolved based on their type and the classes/interfaces they implement, as far as I know.

I propose introducing a wrapper that the resolver could use to extract specific additional information, like this:

container.Resolve<Service>([ Arg<IExactType1>(instance1), Arg<IExactType2>("name", instance2)... ])

This approach would enable us to specify dependencies more explicitly and manage named bindings more effectively.

@z4kn4fein
Copy link
Owner

z4kn4fein commented May 29, 2024

Hi @kicsiede, thank you for the suggestion, and sorry for the late reply! I'll look at both issues soon when I have more free time.

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