|
2
|
| Roman Pokrovskij Archil Labadze · 技术社区 · 7 年前 |
|
|
1
2
修改api路由并添加area属性以提供[area]路由的区域名称。
仅此而已,您可以在 http://localhost:8080/Configuration/api/ConfigurationApi |
|
2
1
其他一些路由选择:
然后 http://localhost:8080/ConfigurationApi/GetUsers 可以,但路由中没有区域,而且“按约定路由到区域”似乎不起作用,这是ASP核心: ASP Core: how to configure area for api controller without AreaAttribute (or how to enable convention area routing for Api controller)? 和 https://github.com/aspnet/AspNetCore/issues/7042
在这种情况下
其他选项:【路由(【区域】/api/【操作】)]路由到 http://localhost:8080/Configuration/api/GetUsers
移除区域属性时引发运行时错误
|