Created
November 15, 2012 09:23
-
-
Save bzbetty/4077607 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
public class InjectedRouteConstraint<T> : IRouteConstraint where T : IRouteConstraint | |
{ | |
private IDependencyResolver _dependencyResolver { get; set; } | |
public InjectedRouteConstraint(IDependencyResolver dependencyResolver) | |
{ | |
_dependencyResolver = dependencyResolver; | |
} | |
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection) | |
{ | |
return _dependencyResolver.GetService<T>().Match(httpContext, route, parameterName, values, routeDirection); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment