title: How can I bind an array with asp-for tag?
body: <p>I would like to ask, how can I bind an array in Asp.NET Core MVC ?</p>
  
  <pre><code>&lt;input type="text" asp-for="Requests[@index].Name" /&gt;
  </code></pre>
  
  <p>It was working very well in older versions of ASP MVC.
  This example shows "Internal server error".</p>
  
  <p>"<em>An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.</em>"</p>
  
  <p>ViewModel class example:</p>
  
  <pre><code>public class ViewModel
  {
      public List&lt;Model&gt; Requests {get;set;}
  }
  </code></pre>
  
  <p>Model class example:</p>
  
  <pre><code>public class Model
  {
      public string Name {get;set;}
  }
  </code></pre>
  
  <p>How it should work ? After you submit a form with these inputs, MVC should automaticly create and map the list in ModelView. That's how It works in ASP.NET MVC 4.</p>