I have created an OrderFormViewModel which looks something like
public class OrderFormViewModel
{
public IOrderDetails { get; set; }
public IDeliveryDetails { get; set; }
public IPaymentDetails { get; set; }
// ... etc
public SelectList DropDownOptions { get; set; }
// ... etc
}
This goes to my Create view, where each section (ie delivery details, payment details... etc) is then passed to a partial view which captures the necessary fields.
I thought this was all quite neat until I ran it and realised of course that the MVC model binder doesn't know how to instantiate any of the interfaces.
Is there a way to resolve this somehow?
I'm also trying to learn DI using Unity container, so I'm tyring to avoid having references to any concrete classes in my UI project (model is in a separate project).