title: MVC3 Razor model binder and inherited collections
body: <p>I hope I'm not missing something incredibly obvious here but is there any reason why model binder is always having trouble binding a view model that inherits from a collection?</p>
  
  <p>Lets say I want to show a paged list and display a combo box and add button above it (dealing with simple lists). Involved classes would look like:</p>
  
  <pre><code>public class PagedList&lt;T&gt; : List&lt;T&gt;
  {
      public int TotalCount { get; set; }
  }
  </code></pre>
  
  <p>And then a view model that looks like:</p>
  
  <pre><code>public class MyViewModel : PagedList&lt;ConcreteModel&gt;
  {
      public IEnumerable&lt;ChildModel&gt; List { get; set; }
      public int? SelectedChildModelId { get; set; }
  }
  </code></pre>
  
  <p>So in the view (Razor):</p>
  
  <pre><code>@model MyViewModel 
  @using (Html.BeginForm())
  {
      @Html.DropDownListFor(model =&gt; model.SelectedChildModelId, new SelectList(Model.List, "ChildModelId", "DisplayName"))
  }
  </code></pre>
  
  <p>And the controller HttpPost action:</p>
  
  <pre><code>public ActionResult(MyViewModel viewModel)
  {
      ...
  }
  </code></pre>
  
  <p>The above will cause viewModel in ActionResult to be null. Is there a logical explanation for it? From what I can tell it's specific only to view models that inherit from collections.</p>
  
  <p>I know I can get around it with custom binder but the properties involved are primitive types and there isn't even any generics or inheritance.</p>
  
  <p>I've reworked the view models to have the collection inherited type as properties and that fixes the issue. However I'm still scratching my head over why the binder breaks down on it. Any constructive thoughts appreciated.</p>