title: Post JSON object array to a Web API
body: <p>I'm having a hard time to find a solution for this problem.
  My API controller is not able to get the content of the array that I posted and is always return 0 element.</p>
  
  <h3>Model class:</h3>
  
  <pre><code>public class Author
  {
      public int id { get; set; }
      public int referenceId{ get; set; }
  
      [Newtonsoft.Json.JsonIgnoreAttribute]
      public virtual ICollection&lt;AuthorBook&gt; AuthorBooks { get; set; }
  }
  
  public class AuthorBook
  {
      public int authorId { get; set; }
      public int bookId { get; set; }
  }
  </code></pre>
  
  <h2>API controller method:</h2>
  
  <pre><code>[Route("api/authorBooks")]
  [HttpPost]
  public IList getAuthorBooks(Author author)
  {
      return author.AuthorBooks.ToList();
  }
  </code></pre>
  
  <h2>JavaScript client:</h2>
  
  <pre><code> var auhtorItem =
        {
            "id": 8,
            "referenceId" : 1 ,
            "AuthorBooks": [{ authorId: 9, bookId : 23 }, { authorId: 9 , bookId  : 25}]
        };
  
  return $.ajax({
      url: booksUrl + "authorBooks",
      type: 'POST',
      data: JSON.stringify(auhtorItem ),
      dataType: 'json',
      contentType: 'application/json',
      crossDomain: true,
      cache: false
  });
  </code></pre>
  
  <p>I'm able to get the id and the referenceId values but the AuthorBooks is empty and the count is 0 instead of 2. </p>
  
  <p>Any idea why?</p>