title: Pass list of Entities from View to controller
body: <p>What I want to do it's simple. I have a view that receives a model that contains 2 lists of 2 entities. I want to pass one of that lists to controller, when I call it. It sounds simple, and I already tried various solution proposed, but can't get this to work. Also I'm new to MVC.</p>
  
  <p><strong>The Model</strong></p>
  
  <pre><code>public class SorteioEspecial
  {
      RepositoryService service = new RepositoryService();
  
      public SorteioEspecial()
      {
          funcionario = new List&lt;Funcionario&gt;();
          ponderacaoFuncionario = new List&lt;PonderacaoFuncionario&gt;();
      }
  
      public IEnumerable&lt;Funcionario&gt; funcionario { get; set; }
      public IEnumerable&lt;PonderacaoFuncionario&gt; ponderacaoFuncionario { get; set; }
  
      public IEnumerable&lt;Funcionario&gt; GetFuncionarios()
      {
          funcionario = service.GetFuncionarios();
          return funcionario;
      }
  
      public IEnumerable&lt;PonderacaoFuncionario&gt; GetPonderacaoFuncionario()
      {
          ponderacaoFuncionario = service.GetPonderacaoFuncionario();
          return ponderacaoFuncionario;
      }
  
  
  }
  </code></pre>
  
  <p><strong>The View</strong></p>
  
  <pre><code>    @model Alpd.Models.SorteioEspecial
  
  @using (@Html.BeginForm("EditarPonderacoesEspecialSecond", "Sorteios",Model.ponderacaoFuncionario, FormMethod.Post))
  {
  
    &lt;div class="filterbox"&gt;
      &lt;table class="table"&gt;
          &lt;tr&gt;
              &lt;th&gt;
                  &lt;b&gt;ID&lt;/b&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;b&gt;ID Funcionário&lt;/b&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;b&gt;Nome Funcionário&lt;/b&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;b&gt;Ponderação&lt;/b&gt;
              &lt;/th&gt;
              &lt;th&gt;
                  &lt;b&gt;Incluir Sorteio&lt;/b&gt;
              &lt;/th&gt;
  
              &lt;th&gt;&lt;/th&gt;
          &lt;/tr&gt;
  
          @foreach (var item in Model.ponderacaoFuncionario)
          {
              &lt;tr&gt;
                  &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.Id)&lt;/td&gt;
                  &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.Funcionario)&lt;/td&gt;
                  &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.Nome_Funcionario)&lt;/td&gt;
                  &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.Ponderacao)&lt;/td&gt;
                  &lt;td&gt;@Html.DisplayFor(modelItem =&gt; item.Incluir_sorteio)&lt;/td&gt;
              &lt;/tr&gt;
          }
      &lt;/table&gt;
  
  &lt;/div&gt;
  &lt;!--
  &lt;div class="col-md-10"&gt;
      &lt;a href='Url.Action("EditarPonderacoesEspecialSecond", "Sorteios", Model.ponderacaoFuncionario)'&gt;
          &lt;input type="submit" value="Editar Ponderações" class="btn-default" /&gt;
      &lt;/a&gt;
  &lt;/div&gt;
  --&gt;
  
  
      @Html.HiddenFor(model =&gt; model.ponderacaoFuncionario)
      @Html.EditorFor(model =&gt; model.ponderacaoFuncionario)
      &lt;input type="submit" value="Editar Ponderações" class="btn-default" /&gt;
  }
  </code></pre>
  
  <p><strong>The controller method</strong></p>
  
  <pre><code>[HttpPost]
      public ActionResult EditarPonderacoesEspecialSecond (SorteioEspecial pf)
      {
          return View(pf);
      }
  </code></pre>
  
  <p>I just want to call the method, passing the list of entities <strong>ponderacaoFuncionario</strong> . Dont want to do anything on the view (just show the table). Also if I am not doing this by the proper way, can you give an advice of how to do it?</p>