title: WebApi Controller, POST object with child collection of complex objects
body: <p>i have to POST this object structure:</p>
  
  <pre><code>public class Parent
  {
      public List&lt;Child&gt; Childs {get; set;}
  }
  
  public class Child
  {
      public String Name {get; set;}
  }
  </code></pre>
  
  <p>I make my POST call with jquery:</p>
  
  <pre><code>var myjson={
     "Childs":[{"Name":"Pippo"},{"Name":"Pluto"}]
  }
  
  $.ajax({
          type: "POST",
          url: "/parent",
          dataType: "json",
          contentType: "application/json",
          data: JSON.stringify(myjson),
          traditional: true,
          success: function (result) {
              console.log(result);
          },
          error: function (error) {
              alert("There was an error posting the data to the server: " + error.responseText);
          }
      });
  </code></pre>
  
  <p>And this is ParentController:</p>
  
  <pre><code>public class ParentController : ApiController{
  
     [HttpPost]
     [ActionName("DefaultAction")]
     public HttpResponseMessage Post(Parent obj){
        // obj.Childs.Count is 2
        // but obj.Childs[0].Name is null
     }
  
  }
  </code></pre>
  
  <p>The problem is i receive a parent object with two childs, but childs have null name.</p>
  
  <hr>
  
  <blockquote>
    <p>Update, i found a workaround
    In this way seems to work:</p>
  </blockquote>
  
  <pre><code>public class ParentController : ApiController{
  
     [HttpPost]
     [ActionName("DefaultAction")]
     public HttpResponseMessage Post(JObject obj){
        Parent p=obj.ToObject&lt;Parent&gt;();
        // p.Childs[0].Name is Pippo
     }
  
  }
  </code></pre>