title: MVC UpdateModel is not updating some of the model properties
body: <p>In my MVC 5 EF Database First project I have been using UpdateModel method in my controller action successfully, but after including some additional fields (previously unused by application) I find that the new fields simply refuse to get values from the UpdateModel method call. The only thing of any significance I can identify is that the fields share part of their name.</p>
  
  <p>Consider this class as an example:</p>
  
  <pre><code>public class Record
  {
  public int ID {get;set;}
  public string Details {get;set;}
  public string DetailsFile {get;set;}
  ...
  }
  </code></pre>
  
  <p>The property/field <code>DetailsFile</code> was previously unused, but now is an optional field on the web form. It is stored in a <code>&lt;input type="hidden" name="DetailsFile" id="DetailsFile /&gt;</code> and is successfully posted to the controller action with the correct value (or empty string).</p>
  
  <p>Within the controller action I handle the update like this:</p>
  
  <pre><code>[HttpPost]
  public async Task&lt;ActionResult&gt; Edit(Record_EditView model, FormCollection collection)
  {
      if (ModelState.IsValid)
      {
          try
          {
              var record = await db.Record.FindAsync(model.ID);
              UpdateModel(record, collection);
              db.Entry(record).State = EntityState.Modified;
              await db.SaveChangesAsync();
          }
          catch(Exception ex)
          {
              throw ex;
          }
      }
      // do more stuff here
      ...
  }
  </code></pre>
  
  <p>Which has been working fine, but with the additional field <strong>all fields except</strong> the <code>DetailsFile</code> get updated from the FormCollection that is passed in. I have inspected both the <code>model</code> and the <code>collection</code> and they have the correct value, but the <code>record</code> never gets the values <strong>until</strong> I do a second post of the same data. Then the values get pushed in to the fields as expected.</p>
  
  <p>I don't get any errors thrown and am at a bit of a loss as to what is going on. For the time being I have resorted to modifying my controller action to this:</p>
  
  <pre><code>[HttpPost]
  public async Task&lt;ActionResult&gt; Edit(Record_EditView model, FormCollection collection)
  {
      if (ModelState.IsValid)
      {
          try
          {
              var record = await db.Record.FindAsync(model.ID);
              UpdateModel(record, collection);
              record.DetailsFile = collection["DetailsFile"]; // &lt;-- Manually insert DetailsFile value
              db.Entry(record).State = EntityState.Modified;
              await db.SaveChangesAsync();
          }
          catch(Exception ex)
          {
              throw ex;
          }
      }
      // do more stuff here
      ...
  }
  </code></pre>
  
  <p>And this works OK, however I'm sure that I shouldn't have to do this, and hope that someone out there can explain what I am overlooking!</p>