In my model I have relationships like this:
[Person]
PersonId (PK)
...
[Orders]
OrderId (PK)
PersonId (FK to Person.PersonId)
...
A person can have multiple orders.
I generated PersonController with Create/Details/List/Edit views. I want to be able to manipulate Orders also, but within the context of a Person. In other words, I'd like the workflow to be
- User browses a list of people (/Persons)
- User selects 'View Orders' link next to a specific Person (/Persons/4/Orders/)
- User sees a list of orders with Create/Details/Edit as well (/Persons/4/Orders/Edit/38)
Is this the right way to set up my controllers/routes? Should I just access orders at routes like (/Orders/Edit/38) instead?
Right now I have:
PersonController OrderController
Should I create a PersonOrderController or can I achieve what I want using only the two controllers I already have?