I have an MVC project and i'm trying to set up StructureMap so I can inject the HttpContext into the controller, but I cannot work out how to do this.
I've done plenty of searching, and I keep coming across pages and forum posts telling me to do something like this:
ForRequestedType<HttpContextWrapper>().TheDefaultIs(new HttpContextWrapper(HttpContext.Current));
The problem I'm having with that is that I can't find a ForRequestedType method anywhere. The posts I'm finding appear to be a few years old, so i'm guessing they are from an older version of StructureMap.
I have installed StructureMap using the structuremap.mvc5 nuget package, which installed v3.1.1.0 of StructureMap.
Can anyone advise me on how to correctly map HttpContext?
Thanks,
Cory.