title: How to generate field names for model state dictionary?
body: <p>The new helper methods EditorFor, TextBoxFor are very cool in avoiding hard coded field names in views.</p>
  
  <p>I'm writing validation functions where services validate complex model data.
  If there is an error with a field the service should push an error for this field into the modelstate dictionary.</p>
  
  <p>Is there an helper method with generates the complete model name?</p>
  
  <p>EDIT:<br>
  Samplemodel:</p>
  
  <pre><code>class CustomModel {
    public InnerModel Inner { get; set; }
  }
  class InnerModel {
    public String Field1 { get; set; }
    public SomethingMoreToValidate[] More { get; set; }
  }
  class SomethingMoreToValidate {
    public int A { get; set; }
    public int B { get; set; }
  }
  </code></pre>
  
  <p>The input field for InnerModel.SomethingMoreToValidate[0].A in the view has the name "InnerModel.SomethingMoreToValidate[0].A". To bind the model state errors to the field, I have to put the errors with this name into the ModelStateDictionary.</p>
  
  <p>In the View displaying the InnerModel data, I can write: </p>
  
  <pre><code>Html.EditorFor(m =&gt; m.SomethingMoreToValidate[0].A);
  </code></pre>
  
  <p>If a property is renamed, compiler warns me.
  In the validating controller or service class I have to write: </p>
  
  <pre><code>ModelState.AddModelError(
    "InnerModel.SomethingMoreToValidate[0].A", 
    "There is a problem with this field");
  </code></pre>
  
  <p>If a property is renamed, there is no feedback if I have no other checks like unittests.
  I would like to write:</p>
  
  <pre><code>ModelState.AddModelErrorFor(
    m =&gt; m.InnerModel.SomethingMoreToValidate[0].A, 
    "There is a problem with this field")
  </code></pre>