I\'m using RC1 of ASP.NET MVC.
I\'m trying to extend Phil Haack\'s model binding example. I\'m trying to use the default model binder to bind the following object:>
To answer my own question:
I'm a dummy!
My example doesn't work because the Items property of the ListOfProducts class is not public:
public class ListOfProducts
{
public int Id { get; set; }
public string Title{ get; set; }
List Items { get; set; }
}
I changed:
List Items { get; set; }
to:
public List Items { get; set; }
and my code then worked.
To conclude the default model binder does work with types that contain properties of type List.