You can look at the implementation of the IReturn<T>.ToUrl() extension method, which does just that, uses custom routes if it is defined otherwise it returns a pre-defined url.
Using:
[Route("/custom/route")] public class RequestDto : IReturn<ResponseDto> { ... } var relativeUrl = new RequestDto { ... }.ToUrl("GET", "json");
mythz source share