Hello,
this question is not about code, at least not about code that gives errors. I am asking this question to know the right way of implementing a pattern in ASP.NET MVC2.
Suppose that I have A Contact object that holds a collection of EmailAddress object. In My ContactController I have regularly actions that do create/edit/delete contacts from the underlying store. Inside my Index View (that render all the contacts) I have a link that says "Add Email" when a Contact is selected in the list.
Now I have at least two ways to implement this Action:
- Inside the ContactController add a AddEmailAddress action that pre-populate the EmailAddress Model object with the ContactID property and render a view
- As in the step 1 but instead of rendering a view delegate this job to a EmailAddressController class
Which is the correct way to handle patterns like this one?
Thanks in advance!