Joachim Rosskopf
Joachim Rosskopf

Reputation: 1269

Link/url-generation in a self-hosted WCF WebApi

What is the 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?

Upvotes: 1

Views: 282

Answers (1)

Pedro Felix
Pedro Felix

Reputation: 1076

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/

Upvotes: 1

Related Questions