Can a WCF ServiceRoute Route Prefix contain a path value?

后端 未结 1 1019
粉色の甜心
粉色の甜心 2021-01-14 09:28

Currently I use this:

RouteTable.Routes.Add(new ServiceRoute(\"API\", new WebServiceHostFactory(),typeof(MySite.Web.MyServiceV1)));

To make

相关标签:
1条回答
  • 2021-01-14 10:08

    I totally forgot that the order you register routes mattered. This works:

    RouteTable.Routes.Add(new ServiceRoute("API/V2/", new WebServiceHostFactory(),typeof(MySite.Web.MyServiceV2)))
    
    RouteTable.Routes.Add(new ServiceRoute("API/", new WebServiceHostFactory(),typeof(MySite.Web.MyServiceV1)));
    
    0 讨论(0)
提交回复
热议问题