LightInject icon indicating copy to clipboard operation
LightInject copied to clipboard

How to use in combination with AutoMapper's ConstructServicesUsing method

Open stefankip opened this issue 4 years ago • 1 comments

Hi! I'm using Umbraco v8, which used LightInject for IoC. In my project I also use AutoMapper v10 and I have this IValueConverter which has a dependency in the constructor. To enable DI for this converter, I have to use the ConstructServicesUsing method. But the type passed to this ConstructServicesUsing method is the IValueConverter itself, not the required dependencies.

So my question is; how can I create an instance of a class (not known in the services registration), which has dependencies (known in the services registration) in it's constructor using LightInject?

stefankip avatar Dec 03 '20 11:12 stefankip

Hi @stefankip

Could you come up with a super simple repro on this?

seesharper avatar Dec 07 '20 12:12 seesharper