Zenject icon indicating copy to clipboard operation
Zenject copied to clipboard

Make InstantiateExplicit to optionally inject extraArgs and not throw errors

Open AndersonDev opened this issue 5 years ago • 1 comments

Is your feature request related to a problem? Please describe. InstantiateExplicit throws Passed unnecessary parameters when injecting into type... exception if some of types are not presented in object constructor. But I instantiate different types, and somme of them need types from extraArgs but some - not.

Describe the solution you'd like Remove exception throw or add some parameter that indicates optional inject.

AndersonDev avatar Dec 04 '20 19:12 AndersonDev

Hello there,

first of all, I'm not a developer of Extenject, but just another user of the library.

To me, it sounds (in general) like a reasonable feature to ask for. If it was implemented, I'd expect an additional parameter that specifies how to deal with issues in the injection (e. g. to many arguments).

On the other hand, what are those values that you need to inject by hand that can't be injected using Extenject directly? The stuff I did with it is limited to be honest, but I didn't come across the need to inject specific values myself so far.

RichardWepner avatar Dec 28 '20 05:12 RichardWepner