This is a general model binding question that applies to MVC 1 & 2. I'm wondering if MVC2 would be better for this, but here's my question:
I have a fairly complex model:
public interface IEvent
public int Id
public string Title
public List<EventContact> Contacts
public List<EventDatesLocations> DatesLocations
public class EventDatesLocations
public int Id
public DateTime StartDate
public DateTime EndDate
public List<EventLocation> Locations
I have a custom model binder for my IEvent class that does basically all the binding for IEvent. I call the default model binder for binding the Contacts
list, which works well.
I am ready to start trying to bind the DatesLocations
stuff, but I want to make sure I'm doing things correctly.
Overall, I'm not sure I have all the details on model binding understood. Would it be better to have multiple model binders for the lists within IEvent
or just have one IEvent
model binder (as I'm doing now) which calls the default binder for the lists it needs.
How do the experts do it? :P