Created
July 13, 2010 18:13
-
-
Save stevenharman/474275 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For<UrlHelper>() | |
.HybridHttpOrThreadLocalScoped() | |
.Use(ctx => | |
{ | |
var httpContext = new HttpContextWrapper(HttpContext.Current); | |
var routeData = RouteTable.Routes.GetRouteData(httpContext); | |
return new UrlHelper(new RequestContext(httpContext, routeData)); | |
}); | |
For<IUrlHelper>() | |
.HybridHttpOrThreadLocalScoped() | |
.Use(ctx => new MvcUrlHelper(ctx.GetInstance<UrlHelper>())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment