I am wondering why routes seem to be configurable from both the HttpConfiguration object and the RouteTable class? Clearly the two .Routes properties are not of the same type, but they seem to stay in-sync. Is there a chance they could get out-of-sync? I'm wondering though, from a Web API perspective, should RouteTable.Routes ever be used?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The HttpConfiguration
class is specific to WebApi making it reusable outside of IIS (e.g. For self hosting). The RouteTable
version is for IIS only.