I have a class:
public class CarList
{
public int quantity{get;set;}
public List Cars {get;set;}
}
public class Car {
public string Name
I think this is the issue:
@foreach (Car item in Model.Cars)
{
@Html.EditorFor(x=>item);
}
Change it to
@foreach (Car item in Model.Cars)
{
@Html.EditorFor(x=>item.Name);
}
It might a case of the model binder not being smart enough to bind more than one level down, although I don't remember ever having that issue. it may also help to add Glimpse (http://getglimpse.com/) to your project so that you can see how the request is actually processed.