Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在自托管的 WCF WebApi 应用程序中生成指向其他资源的链接或 url 的最佳策略是什么,而不需要对主机或端口等进行硬编码?
有类似路线助手的东西吗?
目前,AFAIK 没有对链接/url 生成的特定支持。但是,您可以通过描述模型访问所有必需的信息(例如方案、主机、端口、uri 模板)。见https://pfelix.wordpress.com/2011/05/08/wcf-web-apidescription-model/