title: How to post a list from view to controller mapped to viewModel in Asp.net core?
body: <p>Here is my ViewModel</p>
  
  <pre><code>public class VideoViewModel
  {
      public string Movie { get; set; }
      public int Order { get; set; }
  
      public IList&lt;VideoContent&gt; VideoContents { get; set; }
  }
  </code></pre>
  
  <p>How can I pass data from fields in view to controller mapped to my collection in my viewModel?</p>
  
  <p>This code in my view is passing Movie and Order to controller but I can't figure out hos to send the collection too.</p>
  
  <pre><code>@model ViewModels.VideoViewModel
      &lt;form method="post"&gt;
          &lt;div class="form-group"&gt;
              &lt;label for="movie"&gt;Movie&lt;/label&gt;
              &lt;input type="text" name="Movie" id="movie" class="form-control"&gt;
          &lt;/div&gt;
          &lt;div class="form-group"&gt;
              &lt;label for="order"&gt;Order&lt;/label&gt;
              &lt;input type="text" name="Order" id="order" class="form-control"&gt;
          &lt;/div&gt;            
          &lt;button type="submit" class="btn btn-primary"&gt;Add to database&lt;/button&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>Thanks in advance!</p>
  
  <p>/ Kalle</p>