0

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 ?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.