We are migrating from Microsoft.AspNet.OData [5.9.1] to [6.1.0]. We are running into issues with trying to get our preexisting dependency injection infrastructure to work with the DI support in [6.1.0]. The call to MapODataServiceRoutebuilds a container and then stores it on the HttpConfigurationin a proprietary location. This is problematic because our existing infrastructure has to register it's own services in a composition root, and then use the built container to setup other dependency resolution points.
Assemblies affected
OData WebApi lib 6.1.0
Additional detail
We are trying to hack around this by implementing an IContainerBuilderthat simply captures the built container, but I'm wondering if there is a better way?
Ideally, we could simply pass in a prebuilt container instead of having MapODataServiceRoutedo all the container management behind the scenes. It would be up to the caller to populate the dependencies used by OData, but this can be handled with extension methods.
We are migrating from Microsoft.AspNet.OData [5.9.1] to [6.1.0]. We are running into issues with trying to get our preexisting dependency injection infrastructure to work with the DI support in [6.1.0]. The call to
MapODataServiceRoute
builds a container and then stores it on theHttpConfiguration
in a proprietary location. This is problematic because our existing infrastructure has to register it's own services in a composition root, and then use the built container to setup other dependency resolution points.Assemblies affected
OData WebApi lib 6.1.0
Additional detail
We are trying to hack around this by implementing an
IContainerBuilder
that simply captures the built container, but I'm wondering if there is a better way?Ideally, we could simply pass in a prebuilt container instead of having
MapODataServiceRoute
do all the container management behind the scenes. It would be up to the caller to populate the dependencies used by OData, but this can be handled with extension methods.Example:
Any guidance would be appreciated.