更新时间:2023-08-24 17:45:40
您可以将它们放在单独的命名空间中,例如 MyApp.Controllers.UsersController 和 MyApp.Controllers.WebAPI.UsersController.
You can put them in separate namespaces, e.g MyApp.Controllers.UsersController and MyApp.Controllers.WebAPI.UsersController.
这将允许您在 MVC 和 WebAPI 中公开类似的 URI 路由,例如:
This would let you expose similar URI routes in MVC and WebAPI, eg:
/users/1 << MVC view
/api/users/1 << Web API