In which controller do you put the CRUD for the child part of a relationship?
Posted
by uriDium
on Stack Overflow
See other posts from Stack Overflow
or by uriDium
Published on 2010-03-17T16:40:00Z
Indexed on
2010/03/17
16:41 UTC
Read the original article
Hit count: 219
I am using ASP.Net MVC but this probably applies to all MVC patterns in general. My problem, for example I have companies and in each company I have a list of contacts. When I have selected a company I can see its details and a list of the contacts for that company. When I want to add a new contact for that company, should the implementation of that action go into the company controller as an "AddContact" action or should it go into the contact controller into a "New" action and we pass the Company ID in the URL?
What is the usual way of dealing with this sort of thing in ASP.Net MVC? Is there a better stategy?
© Stack Overflow or respective owner