modesttree / Zenject

Dependency Injection Framework for Unity3D
MIT License
2.47k stars 273 forks source link

Make InstantiateExplicit to optionally inject extraArgs and not throw errors #205

Open AndersonDev opened 3 years ago

AndersonDev commented 3 years ago

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.

RichardWepner commented 3 years ago

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.