Created
June 23, 2016 01:17
-
-
Save dcomartin/ac37d5505e0345e828ba740f5ebca939 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 RouteLinker | |
{ | |
private readonly IResourceLinker _linker; | |
private readonly NancyContext _context; | |
public RouteLinker(IResourceLinker linker, NancyContext context) | |
{ | |
_linker = linker; | |
_context = context; | |
} | |
public string BuildAbsoluteRoute(Route route, dynamic parameters = null) | |
{ | |
return _linker.BuildAbsoluteUri(_context, route.Name, parameters).ToString(); | |
} | |
public string BuildRelativeRoute(Route route, dynamic parameters = null) | |
{ | |
return _linker.BuildRelativeUri(_context, route.Name, parameters).ToString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment