You can move the controllers to any folder and the web api framework will find it as long as your controllers implement the interface System.Web.Http.Controllers.IHttpController
or inherit from ApiController
, which implements this interface and is a common usage pattern.
moving web api controllers within solution
-
05-10-2022 - |
Pergunta
I have a Visual Studio MVC5 project, I also have a Telerik Data Access project, I have created Web Api controllers form my Data Access models. My question is:
Can I move the created controller files (.cs) from the root of my project to a folder? Like the Controllers folder for example.
Hope this makes sense and thanks in advance.
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow