title: Asp.Net ApiController - post object contains only zeros
body: <p>In my api controller I have the following code</p>
  
  <pre><code>    public class RunReportController : System.Web.Http.ApiController
      {
          [HttpPost]
          public IHttpActionResult Post([FromUri]string reportname, [FromBody]IsoDate date)
          {
              // the code here is running but the IsoDate is never set correctly
              // reportname is working ok and set to correct values
          }
      }
  </code></pre>
  
  <p>Iso date is declared as follows:</p>
  
  <pre><code>public class IsoDate
  {
      int Year { get; set; }
      int Month { get; set; }
      int Day { get; set; }
  
      public IsoDate()
      {
      }
  }
  </code></pre>
  
  <p>And this is the way I call it from the page:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "/api/admin/report/some-report",
      data: JSON.stringify({Year:2019,Month:1,Day:1}),
      contentType : 'application/json'
  }).success(()=&gt;{console.log("ok")}).fail(()=&gt;{console.log("bad")});
  </code></pre>
  
  <p>And this is how the route is declared:</p>
  
  <pre><code>config.Routes.MapHttpRoute(name: "RunReport", routeTemplate: "api/Admin/Report/{reportname}", defaults: new { controller = "RunReport" });
  </code></pre>
  
  <p>Somehow IsoDate is never assigned any values and always stores 3 zeros. I know I could put the date in the URI but I will need other reports which will take some more complex data (using a different route of course). I need my controllers to accept objects from the body.</p>
  
  <p>Another finding is - if I replace the type of the <code>date</code> parameter to <code>Dictionary&lt;string,int&gt;</code> is starts to work straight away.</p>