Skip to content

Instantly share code, notes, and snippets.

@bzbetty
Created November 15, 2012 09:24
Show Gist options
  • Save bzbetty/4077612 to your computer and use it in GitHub Desktop.
Save bzbetty/4077612 to your computer and use it in GitHub Desktop.
var _dependencyResolver = DependencyResolver.Current; //Get this from private variable that you can override when unit testing
routes.MapRoute(
"Countries",
"countries/{country}",
new {
controller = "Countries",
action = "Index"
},
new {
country = new InjectedRouteConstraint<CountryRouteConstraint>(_dependencyResolver);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment