So far we can use Html.EditorFor() to dynamically render the appropriate template for a datatype - e.g. string, int, or a custom type, say 'Address'.
Now I want to use EditorFor() to render a 'Parent' field. I want a drop-down containing every row, and the user picks a parent from this drop-down.
The 'Parent' template has access to the 'ParentID', but what about the names and ID's of rows, to populate the list-box with?
Where should these come from?
I could put data-access logic in the template, but that would be violating the separation of concerns.
I could create an HtmlHelper that renders the list, but wouldn't this also break separation of concerns, since HtmlHelpers should only do UI stuff, not data access?
Any ideas?