title: How to iterate through all properties in a ViewModel
body: <p>I have a lot of repeated code in my asp.net MVC views</p>
  
  <pre><code>    &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.MyProperty)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.EditorFor(model =&gt; model.MyProperty)
          @Html.ValidationMessageFor(model =&gt; model.MyProperty)
      &lt;/div&gt;
  </code></pre>
  
  <p>I want to wrap this in something like:</p>
  
  <pre><code>foreach (System.Reflection.PropertyInfo item in Model.GetType().GetProperties())
  </code></pre>
  
  <p>and reuse the same partial view throughout.  But I can't get the syntax quite right.</p>
  
  <p>How can I make this more generic?</p>