Working with ViewModels, I would like to split them:
public SignUpViewModel //for display
{
public SignUpUserViewModel SignUpUserViewModel { get; set; } //for validation
public IEnumerable<SelectListItem> UserTypes {get;set;}
}
So I want to render SignUpViewModel but get SignUpUserViewModel as an argument of POST-action.
Do you find this reasonable? What are the ways to implement this approach?
Looks like DefaultModelBinder doesn't work this way: it doens't understand SignUpUserViewModel is a property of SignUpViewModel. So one way I see is to implement custom model binder. Any other?