The Email public constructor that accepts an ILogger is injected with an instance of the chosen implementation so I can see that the dependency resolver seems to be working fine except with usercontrols...
I tried to implement DI the Umbraco4 way (webforms instead of MVC) but it didn't work.
I am not looking forward to having my usercontrols converted to MVC views as they're somewhat complex and it would take too long to do that.
I didn't want to do service location here but I feel I am stuck here with it. Any suggestions on how to have the properties injected?
Can't use IoC in Umbraco 6 UserControls?
I have some user controls in an umbraco 6 instance.
There's the need to put a repository in there and, after installing Autofac, I was expecting the property IRepository automatically injected.
But that's always null.
Here's my register events class that registers the container:
If I do:
The Email public constructor that accepts an ILogger is injected with an instance of the chosen implementation so I can see that the dependency resolver seems to be working fine except with usercontrols...
I tried to implement DI the Umbraco4 way (webforms instead of MVC) but it didn't work.
I am not looking forward to having my usercontrols converted to MVC views as they're somewhat complex and it would take too long to do that.
I didn't want to do service location here but I feel I am stuck here with it. Any suggestions on how to have the properties injected?
is working on a reply...