0

Hey there, I'm at the moment trying to make a product management application. The way it works is that you add/edit/delete a Product Category for example "Ventrilo" and then you can add/edit/delete products in that category. Now is my question do I need a controller for both the Category part and the Product part? Like:

/products/categories/add

/products/products/add/{categoryId}/

or is there a way that I somehow can combine it? Seems odd to me that I need 2 controllers for such a thing.. but maybe it's just me.

1 Answer 1

3

I'd code that in separate controllers because they are operations on different entities.

However, it's not a technical limitation, you can have all actions in a single controller if you wish, you just have to override the default routes.

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

1 Comment

Well.. both the Category and the Product have a lot of same actions.. like add/delete/edit which would be odd to combine into one controller. But I think I'll go with your suggestion. Thanks for the fast response :)

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.