The StructureMap is used for dependency injection in a Mvc5-WebApi2 application I have. both StructureMap and Mvc5. Nuget packages for WebApi2. For both MVC and Web controllers, I want to register my EF 6 DbContext with the HttpContext lifecycle. I need a quick description of how to do this for both MVC and WebApi. Can someone take me in that direction? How can I generally register some dependencies in the parent container and others in the per request container?