I guess the reason is that all other controllers get their rependencies from the Services property of the UmbracoApiControllerBase class while the HealthCheckController, probably because it was a 3rd party plugin included into the core, manages dependency its own way.
I think the point here is:
- as user of a framework, I shouldn't need to wire up dependencies for internals of the framework myself. I should only bother about my own dependencies.
Maybe Umbraco should ship a small extension method for each of the main IoC container out there which wires up all the internals.
Or come with a IoC container out of the box and then everyone using umbraco have to use that one.
Yup that's something that has been discussed and would be great to have. I know Claus has been talking about doing this for a while. Would be a super easy project to do and just have various Nuget packages to support it.
HealthCheckController doesn't work with WebAPI and Unity
Still in the IoC world, after enabling ioc using with Unity for webapi I discovered that the HealthCheckController doesn't work.
The reason is that it has 2 constructors, one parameterless and one with a service.
So, only way to have it working is forcing it to use the parameterless controller.
I guess the reason is that all other controllers get their rependencies from the
Services
property of theUmbracoApiControllerBase
class while the HealthCheckController, probably because it was a 3rd party plugin included into the core, manages dependency its own way.I created an issue: [U4-9562]
Have replied to that issue
I think the point here is: - as user of a framework, I shouldn't need to wire up dependencies for internals of the framework myself. I should only bother about my own dependencies. Maybe Umbraco should ship a small extension method for each of the main IoC container out there which wires up all the internals. Or come with a IoC container out of the box and then everyone using umbraco have to use that one.
Yup that's something that has been discussed and would be great to have. I know Claus has been talking about doing this for a while. Would be a super easy project to do and just have various Nuget packages to support it.
is working on a reply...