Reputation:
Suppose you have a PostController
for your web part, Where you are returning your views etc, And you need an Api
also, What will be the best place to put the logic for Api
.
Is the PostController
will have the Api
methods, Or another ApiPostController
will be good place ?
Upvotes: 0
Views: 431
Reputation: 4738
This is an opinion based question, there is no correct answer.
Personally i place my API and web controllers into separate sub folders of the controllers
folder, give them separate namespaces, and then in my route groups prefix the correct namespace.
Upvotes: 2