Is there a recommended approach for injecting an Http / Request / Controller context in an ASP.NET MVC application?
I used to do this only with HttpContext (I use StructureMap):
For<HttpContextBase>().Use(ctx => new HttpContextWrapper(HttpContext.Current));
However, in some cases, I also need to access the request context. Instead of building it manually, it would be nice if it were introduced. A good example would be an UrlHelper injection (RequestContext and RouteCollection required).
thanks
Ben
source share