What is the开发者_C百科 best strategy to generate links or urls to other resources in a self-hosted WCF WebApi application, without hard-coding something like host or port, etc.
Is there something like a route-helper?
Currently, AFAIK, there isn't specific support for link/url generation. However, you can access all the required information (e.g. scheme, host, port, uri template) via the description model. See https://pfelix.wordpress.com/2011/05/08/wcf-web-apidescription-model/
精彩评论