title: Passing Json Data to MVC Controller
body: <p>Here I need to pass Json object to the controller.But i have a problem in the MVC JsonResult controller area. I have no idea how to get those objects there. In <strong>ItemQtys</strong> there are multiple values.</p>
  
  <p>My Code:</p>
  
  <pre><code>    $("#btnSubmit").click(function (e) {
  
          var itemQtys = [];
  
          var currentQty;
          $('input.input-qty').each(function (itm) {
              currentQty = $(this).val();
              if (!isNaN(currentQty) &amp;&amp; currentQty != '') {
                  currentQty = parseInt(currentQty);
  
                  itemQtys.push({
                      ItemId: $(this).attr('data-id'),
                      Qty: currentQty
                  });
              }
          });
  
          var data = {
              UserId: $("#CustomerName option:selected").val(),
              DeliveryInstructions: $('#DeliveryInstructions').val(),
              ItemQtys: itemQtys
          };
  
  
  
          $.ajax({
              type: "POST",
              url: "/Orders/SubmitCustomerOrder",
              contentType: "application/; charset=utf-8",
              dataType: "json",
              data: data,
              async: false,
              success: function (msg) {
                  if (msg.length &gt; 0) {
                      $.each(function (response) {
                          //$("#Result").text(response.text);
                      });
                  }
              }
  
          });
  
      });
  </code></pre>
  
  <p>MVC Controller: (I want to get the values to here)</p>
  
  <pre><code> public JsonResult SubmitCustomerOrder(OrdersModels model, int? id)
      {
  
          return Json(new {  });
  
      }
  </code></pre>
  
  <p>My model:</p>
  
  <pre><code>  public class OrdersModels : DbContext
  {
      public class CustomerOrders
      {
          public int CustomerOrderId { get; set; }
          //public int CustomerId { get; set; }
          public DateTime OrderDate { get; set; }
          public DateTime DeliveryDate { get; set; }
          public string DeliveryInstructions { get; set; }
          public int Status { get; set; }
          public int Customer_Supplier_CustomerSupplierId { get; set; }
          public DateTime ModifiedDate { get; set; }
          public Guid ModifiedBy { get; set; }
          public bool IsActive { get; set; }
          public List&lt;OrderItems&gt; OrderItemList { get; set; }
  
      }
  
      public class OrderItems
      {
          public int OrderItemsId { get; set; }
          public int Products_ProductId { get; set; }
          public int CustomerOrders_CustomerOrderId { get; set; }
          public int Quantity { get; set; }
          public DateTime ModifiedDate { get; set; }
          public Guid ModifiedBy { get; set; }
          public bool IsActive { get; set; }
      }
  }
  </code></pre>