title: Post Multiple Data from View to Controller MVC
body: <p>I want to post quantity property to Controller (It's an edit action). I'm editing OrderedProductSet which is connected with ProductSet  in my SQL Database (I get the name and price from there). How to pass multiple data from the view to controller? How to write method in controller class to receive the data (I'm asking about method arguments in this specific case).</p>
  
  <p>My view:</p>
  
  <pre><code>@model Shop.Models.ProductViewModel@{
  ViewBag.Title = "Edycja zamówienia";
   }
  
  &lt;h2&gt;Edycja zamówienie&lt;/h2&gt;
  @using (Html.BeginForm())
  {
  @Html.AntiForgeryToken()
  &lt;table class="table"&gt;
      &lt;tr&gt;
          &lt;th&gt;
              &lt;b&gt;Nazwa produktu&lt;/b&gt;
          &lt;/th&gt;
          &lt;th&gt;
              &lt;b&gt;Cena&lt;/b&gt;
          &lt;/th&gt;
          &lt;th&gt;
              &lt;b&gt;Ilość&lt;/b&gt;
          &lt;/th&gt;
  
          &lt;th&gt;&lt;/th&gt;
      &lt;/tr&gt;
  
      @foreach (var item in Model.orderedProductSet)
      {
          &lt;tr&gt;
  
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.ProduktSet.name)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.ProduktSet.price)
              &lt;/td&gt;
  
              &lt;td&gt;
                  @Html.EditorFor(model =&gt; item.quantity, new { htmlAttributes = new { @class = "form-control" } })
              &lt;/td&gt;
          &lt;/tr&gt;
      }
  
  &lt;/table&gt;
  
  
  &lt;div class="form-group"&gt;
  &lt;div class="col-md-offset-2 col-md-10"&gt;
      &lt;input type="submit" value="Potwierdź zmiany" class="btn btn-default" /&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  }
  
  
  
  &lt;div&gt;
  @Html.ActionLink("Powrót", "Index")
  &lt;/div&gt;
  @section Scripts {
  @Scripts.Render("~/bundles/jqueryval")
  }
  </code></pre>
  
  <p>My model (in separated classes of course):</p>
  
  <pre><code> public class ProductViewModel
  {
       public OrderSet orderSet { get; set; }
       public IEnumerable&lt;OrderedProductSet&gt; orderedProduktSet { get; set; }
  }
  
  
  public partial class OrderedProduktSet
  {
      public int orderNumber{ get; set; }
      public int productNumber { get; set; }
      public int ilosc { get; set; }
  
      public virtual ProduktSet ProduktSet { get; set; }
      public virtual OrderSet OrderSet { get; set; }
  }
  </code></pre>