Passing complex data to an MVC Action (opinions please)
I use Nested Content a lot. An example might be a sidebar when users add several different types of content (I'm don't really want in to discussing Nested Content/ Archetype/ Grid Layout). However on occasion one of these sidebar elements is complex and warrants rendering via it's own MVC Action.
The problem I have is that in these situations I have content from the sidebar element that I want the Action to have, but there may be many fields in the NestedContent IPublishedContent object and I need to pass these to the action.
So what is the best thing to do?:
Pass the many fields as individual route values
Pass the IPublishedContent as a route value (passing such a complex object seems wrong)
Create a new classes just for passing my data as a single route value (this would be complex because there is nested content inside nested content)
Pass the page id and the index of the sidebar element and re-retrieve the data from the content cache
Passing complex data to an MVC Action (opinions please)
I use Nested Content a lot. An example might be a sidebar when users add several different types of content (I'm don't really want in to discussing Nested Content/ Archetype/ Grid Layout). However on occasion one of these sidebar elements is complex and warrants rendering via it's own MVC Action.
The problem I have is that in these situations I have content from the sidebar element that I want the Action to have, but there may be many fields in the NestedContent IPublishedContent object and I need to pass these to the action.
So what is the best thing to do?:
Cheers,
David
is working on a reply...