title: How do I make my list based editor template bind properly for a POST action?
body: <p>I have a model, <code>ApplicantBranchList</code>, that is used as a property in a larger model as follows:</p>
  
  <pre><code>[Display(Name = "Where would you want to work?")]
  public ApplicantBranchList PreferedBranches { get; set; }
  </code></pre>
  
  <p><em><strong><code>ApplicantBranchList</code>:</em></strong></p>
  
  <pre><code>public class ApplicantBranchList : ViewModel
  {
      public ApplicantBranchItem HeaderItem { get; set; }
      public ApplicantBranchList()
      {
          HeaderItem = new ApplicantBranchItem();
      }
      public void MapFromEntityList(IEnumerable&lt;ApplicantBranch&gt; applicantBranches)
      {
          var service = new BranchService(DbContext);
          var selectedIds = applicantBranches.Select(b =&gt; b.BranchId);
          Items = service.ReadBranches()
                         .Where(i =&gt; !i.IsDeleted)
                         .Select(p =&gt; new ApplicantBranchItem { BranchName = p.Name, WillWorkAt = selectedIds.Contains(p.Id) });
      }
      public IEnumerable&lt;ApplicantBranchItem&gt; Items { get; set; }
  }
  </code></pre>
  
  <p><code>ApplicantBranchList</code> has its own editor template, and an inner editor template for each item in <code>ApplicantBranchList</code>:</p>
  
  <p><em><strong>Views/Shared/EditorTemplates/ApplicantBranchList.cshtml:</em></strong></p>
  
  <pre><code>@model Comair.RI.UI.Models.ApplicantBranchList
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th style="display: none;"&gt;&lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.HeaderItem.BranchName)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.HeaderItem.WillWorkAt)
          &lt;/th&gt;
      &lt;/tr&gt;
      @foreach (var item in Model.Items)
      {
          @Html.EditorFor(m =&gt; item)
      }
  &lt;/table&gt;
  </code></pre>
  
  <p><em><strong>Views/Shared/EditorTemplates/ApplicantBranchItem.cshtml:</em></strong></p>
  
  <pre><code>@model Comair.RI.UI.Models.ApplicantBranchItem
  &lt;tr&gt;
      &lt;td style="display: none;"&gt;
          @Html.HiddenFor(m =&gt; m.BranchId)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.DisplayFor(m =&gt; m.BranchName)
      &lt;/td&gt;
      &lt;td&gt;
          @Html.EditorFor(m =&gt; m.WillWorkAt)
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>This editor renders properly in the view, but in the post action:</p>
  
  <pre><code>public ActionResult Create(ApplicantProfileModel model)
  {
      if (ModelState.IsValid)
      {
          var branches = model.PreferedBranches;
  </code></pre>
  
  <p><code>PreferedBranches.Items</code> is <code>null</code>.</p>
  
  <p>What am I doing wrong?</p>