title: Why MVC model binding correctly resolve complex object if request is issued by POST and dosen't resolve if issued by GET?
body: <p>In my controller i defined a Customer viewmodel class like below.</p>
  
  <p>There are two properties FirstName, LastName and a 3rd property Orders wich is a collection of Order</p>
  
  <pre><code>public class Customer
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public List&lt;Order&gt; Orders { get; set; }
  }
  
  public class Order
  {
      public int OrderId { get; set; }
      public string OrderBy { get; set; }
  }
  
  public class TestController : Controller
  {
  
      public ActionResult TestCustomer1(Customer customer)
      {
          return Json(customer);
      }
  }
  </code></pre>
  
  <p>I submit data to the controller by an ajax call when client click a button and invoke <code>OnCustomerClick()</code> </p>
  
  <pre><code>function OnCustomerClick() {
  
      var complexObject = {
          FirstName: 'Saroj',
          LastName: 'K',
          Orders: [{ OrderId: 1, OrderBy: 'Saroj' }, { OrderId: 2, OrderBy: 'Kumar' }]
      };
  
      var obj = { customer: complexObject };
      var data2send = obj;
      $.ajax({
          type: "POST",
          url: 'TestCustomer1',
          data: data2send,
          success: function (arg) { //call successfull
          },
          error: function (xhr) {
              //error occurred
          }
      });
  };
  </code></pre>
  
  <p>The point is when the action is invoked like above by a <strong>type: POST</strong> request the Customer parameter in the controller action is successfully populated, when instead i invoke the action by a <strong>type: GET</strong> the parameter object is instantiated with properties set to null.</p>
  
  <p>The string that represents the serialized object is exactly the same in both of the two cases, only change the way that string is passed to the action: body request in the first case, url parameter in the second one.</p>
  
  <p><strong>Request body in POST request</strong>
  customer%5BFirstName%5D=Saroj&amp;customer%5BLastName%5D=K&amp;customer%5BOrders%5D%5B0%5D%5BOrderId%5D=1&amp;customer%5BOrders%5D%5B0%5D%5BOrderBy%5D=Saroj&amp;customer%5BOrders%5D%5B1%5D%5BOrderId%5D=2&amp;customer%5BOrders%5D%5B1%5D%5BOrderBy%5D=Kumar</p>
  
  <p><strong>Query string in GET request</strong>
  /TestCustomer1?customer%5BFirstName%5D=Saroj&amp;customer%5BLastName%5D=K&amp;customer%5BOrders%5D%5B0%5D%5BOrderId%5D=1&amp;customer%5BOrders%5D%5B0%5D%5BOrderBy%5D=Saroj&amp;customer%5BOrders%5D%5B1%5D%5BOrderId%5D=2&amp;customer%5BOrders%5D%5B1%5D%5BOrderBy%5D=Kumar </p>
  
  <p>Can anyone enlighten me on this to why the behavior of model binding change in the two cases?</p>