title: .Net Core Model Binding JSON Post To Web API
body: <p>Just started a new project using .NET Core. Added my Web API controller and related method. Using Postman I created a JSON object and posted it to my controller method. Bear in mind the JSON object matches the Object param in the controller method exactly.</p>
  
  <p>In debug mode I can see the object, it is not null, the properties are there, HOWEVER the prop values are defaulted to their representatives types, <code>0</code> for <code>int</code>, etc.</p>
  
  <p>I've never seen this behavior before… so I took exactly the same code and object and replicated in a MVC project with a Web API 2 controller and it works perfectly.</p>
  
  <p>What am I missing, can I not POST JSON and model bind in .NET Core?</p>
  
  <p>Reading this article it seems I cannot unless I send as form POST or as querystring vars which by the way works fine.</p>
  
  <p><a href="https://lbadri.wordpress.com/2014/11/23/web-api-model-binding-in-asp-net-mvc-6-asp-net-5/" rel="noreferrer">https://lbadri.wordpress.com/2014/11/23/web-api-model-binding-in-asp-net-mvc-6-asp-net-5/</a></p>
  
  <p>JSON:</p>
  
  <pre><code>{
     "id": "4",
     "userId": "3"
     "dateOfTest": "7/13/2017"
  }
  </code></pre>
  
  <p>Method:</p>
  
  <pre><code>[HttpPost]
  [Route("test1")]
  [AllowAnonymous]
  public IActionResult Test(Class1 data)
  {
      return Ok();
  }
  </code></pre>