tags:

views:

30

answers:

1

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.

+3  A: 

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.

Mauricio Scheffer
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 :)
ebb